phylotree 2.6.0 → 2.6.1
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 +1 -1
- package/dist/phylotree-menus.css +93 -0
- package/dist/phylotree.d.ts +473 -241
- package/dist/phylotree.js +1719 -717
- package/dist/phylotree.min.js +1 -1
- package/package.json +21 -12
- package/src/render/clades.js +5 -2
- package/src/render/draw.js +35 -33
- package/src/render/edges.js +5 -5
- package/src/render/events.js +2 -3
- package/src/render/menus.js +27 -4
- package/src/render/nodes.js +27 -7
- package/src/render/options.js +3 -1
- package/src/render/selection-sets.js +12 -14
- package/src/rooting.js +3 -0
package/README.md
CHANGED
|
@@ -31,7 +31,7 @@ const renderer = tree.render({
|
|
|
31
31
|
|
|
32
32
|
### TypeScript Support
|
|
33
33
|
|
|
34
|
-
phylotree.js includes TypeScript declarations. Import types alongside the main export:
|
|
34
|
+
phylotree.js includes TypeScript declarations. They build on the d3 types, so `@types/d3` is installed with the package as a dependency. Import types alongside the main export:
|
|
35
35
|
|
|
36
36
|
```typescript
|
|
37
37
|
import { phylotree, PhylotreeNode, RenderOptions } from "phylotree";
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* phylotree-menus.css - Standalone menu styles (no Bootstrap dependency)
|
|
3
|
+
*
|
|
4
|
+
* This file provides native styling for phylotree context menus.
|
|
5
|
+
* Include this CSS file to use menus without Bootstrap.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
.phylotree-context-menu {
|
|
9
|
+
position: absolute;
|
|
10
|
+
display: none;
|
|
11
|
+
min-width: 160px;
|
|
12
|
+
padding: 8px 0;
|
|
13
|
+
margin: 0;
|
|
14
|
+
background-color: #ffffff;
|
|
15
|
+
border: 1px solid rgba(0, 0, 0, 0.15);
|
|
16
|
+
border-radius: 4px;
|
|
17
|
+
box-shadow: 0 6px 12px rgba(0, 0, 0, 0.175);
|
|
18
|
+
z-index: 1000;
|
|
19
|
+
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
|
|
20
|
+
font-size: 14px;
|
|
21
|
+
color: #212529;
|
|
22
|
+
list-style: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.phylotree-menu-item {
|
|
26
|
+
display: block;
|
|
27
|
+
padding: 6px 20px;
|
|
28
|
+
color: #212529;
|
|
29
|
+
text-decoration: none;
|
|
30
|
+
cursor: pointer;
|
|
31
|
+
white-space: nowrap;
|
|
32
|
+
background-color: transparent;
|
|
33
|
+
border: none;
|
|
34
|
+
width: 100%;
|
|
35
|
+
text-align: left;
|
|
36
|
+
box-sizing: border-box;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.phylotree-menu-item:hover,
|
|
40
|
+
.phylotree-menu-item:focus {
|
|
41
|
+
background-color: #f8f9fa;
|
|
42
|
+
color: #16181b;
|
|
43
|
+
outline: none;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.phylotree-menu-item:active {
|
|
47
|
+
background-color: #e9ecef;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.phylotree-menu-divider {
|
|
51
|
+
height: 0;
|
|
52
|
+
margin: 8px 0;
|
|
53
|
+
overflow: hidden;
|
|
54
|
+
border-top: 1px solid #e9ecef;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.phylotree-menu-header {
|
|
58
|
+
display: block;
|
|
59
|
+
padding: 6px 20px;
|
|
60
|
+
margin-bottom: 0;
|
|
61
|
+
font-size: 12px;
|
|
62
|
+
font-weight: 600;
|
|
63
|
+
color: #6c757d;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
text-transform: uppercase;
|
|
66
|
+
letter-spacing: 0.5px;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
/* Selection set color indicators */
|
|
70
|
+
.phylotree-set-indicator {
|
|
71
|
+
display: inline-block;
|
|
72
|
+
width: 10px;
|
|
73
|
+
height: 10px;
|
|
74
|
+
border-radius: 50%;
|
|
75
|
+
margin-right: 8px;
|
|
76
|
+
vertical-align: middle;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* Animation for menu appearance */
|
|
80
|
+
.phylotree-context-menu[style*="display: block"] {
|
|
81
|
+
animation: phylotree-menu-fade-in 0.15s ease-out;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@keyframes phylotree-menu-fade-in {
|
|
85
|
+
from {
|
|
86
|
+
opacity: 0;
|
|
87
|
+
transform: translateY(-4px);
|
|
88
|
+
}
|
|
89
|
+
to {
|
|
90
|
+
opacity: 1;
|
|
91
|
+
transform: translateY(0);
|
|
92
|
+
}
|
|
93
|
+
}
|