chrono-phylo-tree 1.0.6 → 1.0.7
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 +49 -0
- package/package.json +1 -1
package/README.md
CHANGED
@@ -12,6 +12,11 @@ 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.7**
|
16
|
+
|
17
|
+
- The default duration of the ancestors and descendants are the duration of the species
|
18
|
+
- MultiplePhTrees component allows to show the phylogenetic tree from multiple common ancestors
|
19
|
+
|
15
20
|
**1.0.5**
|
16
21
|
|
17
22
|
- PhTree's lines' width can depend or not on the species' duration
|
@@ -455,6 +460,50 @@ The component renders an SVG element that contains the phylogenetic tree. It use
|
|
455
460
|
|
456
461
|
The `PhTree` component can be customized using the various props it accepts. Additionally, the `children` render prop allows for further customization of the menu content displayed when a species node is clicked.
|
457
462
|
|
463
|
+
## MultiplePhTrees Component
|
464
|
+
|
465
|
+
The `MultiplePhTrees` component is a React-based visualization tool designed to display multiple phylogenetic trees from a list of species. It allows users to visualize and interact with multiple trees simultaneously, providing a comprehensive view of evolutionary relationships among different species.
|
466
|
+
|
467
|
+
### Features
|
468
|
+
|
469
|
+
- **Multiple Tree Visualization**: Displays multiple phylogenetic trees based on a list of species, each with its own evolutionary lineage.
|
470
|
+
|
471
|
+
- **Common Ancestor Management**: Automatically creates a common ancestor for the provided species list, ensuring a unified visualization.
|
472
|
+
|
473
|
+
- **Customizable Appearance**: Supports customization of tree dimensions, padding, stroke color, and number formatting.
|
474
|
+
|
475
|
+
- **Interactive Tree Visualization**: Users can interact with the trees by toggling the visibility of species and accessing detailed information through a menu.
|
476
|
+
|
477
|
+
### Properties
|
478
|
+
|
479
|
+
The `MultiplePhTrees` component accepts the following props:
|
480
|
+
|
481
|
+
- **speciesList**: `Species[]` - An array of species that will be used to generate the phylogenetic trees.
|
482
|
+
|
483
|
+
- **width**: `number` (optional, default: `1000`) - The width of the SVG canvas.
|
484
|
+
|
485
|
+
- **height**: `number` (optional, default: `50`) - The height per descendant of the SVG canvas.
|
486
|
+
|
487
|
+
- **padding**: `number` (optional, default: `0`) - The padding around the tree.
|
488
|
+
|
489
|
+
- **stroke**: `string` (optional, default: `"grey"`) - The stroke color for the tree lines.
|
490
|
+
|
491
|
+
- **format**: `(n: number) => string` (optional, default: `(n) => n.toString()`) - A function to format the display of time values.
|
492
|
+
|
493
|
+
- **chronoScale**: `boolean` (optional, default: `true`) - If `true`, the width of the lines depends on the duration of the species.
|
494
|
+
|
495
|
+
- **presentTime**: `number` (optional) - The current time to highlight in the tree.
|
496
|
+
|
497
|
+
- **children**: `(species: Species, showMenu: boolean, toggleShowMenu: (species: Species) => void) => React.ReactNode` (optional) - Render prop to customize the menu content.
|
498
|
+
|
499
|
+
### Rendering
|
500
|
+
|
501
|
+
The component renders an SVG element that contains the phylogenetic trees. It uses the `PhTree` component to recursively draw the tree structure for each species in the list. The `children` render prop is conditionally rendered based on the `showMenu` state, allowing for further customization of the menu content displayed when a species node is clicked.
|
502
|
+
|
503
|
+
### Customization
|
504
|
+
|
505
|
+
The `MultiplePhTrees` component can be customized using the various props it accepts. Additionally, the `children` render prop allows for further customization of the menu content displayed when a species node is clicked.
|
506
|
+
|
458
507
|
## Menu Component
|
459
508
|
|
460
509
|
The `Menu` component provides a user interface to edit and manage species data. It allows users to modify species attributes, add descendants or ancestors, and delete species.
|