@extantape/onephylogeny-react 0.0.0-stage → 0.1.0-alpha.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/LICENSE +75 -0
- package/README.md +6 -2
- package/dist/canvas.d.ts +19 -0
- package/dist/canvas.js +132 -0
- package/dist/chunk-RIXPX6T6.js +884 -0
- package/dist/chunk-YY252G72.js +89 -0
- package/dist/icons.d.ts +80 -0
- package/dist/icons.js +8 -0
- package/dist/index.d.ts +160 -0
- package/dist/index.js +48 -0
- package/package.json +64 -3
- package/src/styles.css +63 -0
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// src/icons.tsx
|
|
2
|
+
import { jsx } from "react/jsx-runtime";
|
|
3
|
+
var ICON_PATHS = {
|
|
4
|
+
/** lucide: plus */
|
|
5
|
+
plus: "M5 12h14M12 5v14",
|
|
6
|
+
/** lucide: minus */
|
|
7
|
+
minus: "M5 12h14",
|
|
8
|
+
/** lucide: zoom-in */
|
|
9
|
+
zoomIn: "M3 11a8 8 0 1 0 16 0a8 8 0 1 0 -16 0M21 21L16.65 16.65M11 8L11 14M8 11L14 11",
|
|
10
|
+
/** lucide: zoom-out */
|
|
11
|
+
zoomOut: "M3 11a8 8 0 1 0 16 0a8 8 0 1 0 -16 0M21 21L16.65 16.65M8 11L14 11",
|
|
12
|
+
/** lucide: scan */
|
|
13
|
+
fit: "M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2",
|
|
14
|
+
/** lucide: download */
|
|
15
|
+
download: "M12 15V3M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4m7 10 5 5 5-5",
|
|
16
|
+
/** lucide: printer */
|
|
17
|
+
print: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6M7 14h10a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1Z",
|
|
18
|
+
/** lucide: undo-2 */
|
|
19
|
+
undo: "M9 14 4 9l5-5M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",
|
|
20
|
+
/** lucide: redo-2 */
|
|
21
|
+
redo: "m15 14 5-5-5-5M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13",
|
|
22
|
+
/** lucide: chevrons-up-down */
|
|
23
|
+
expand: "m7 15 5 5 5-5m7 9 5-5 5 5",
|
|
24
|
+
/** lucide: chevrons-down-up */
|
|
25
|
+
collapse: "m7 20 5-5 5 5m7 4 5 5 5-5",
|
|
26
|
+
/** lucide: arrow-down-up */
|
|
27
|
+
flip: "m3 16 4 4 4-4M7 20V4m21 8-4-4-4 4M17 4v16",
|
|
28
|
+
/** lucide: focus */
|
|
29
|
+
focus: "M9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2",
|
|
30
|
+
/** lucide: expand */
|
|
31
|
+
unfocus: "m15 15 6 6m15 9 6-6M21 16v5h-5M21 8V3h-5M3 16v5h5m3 21 6-6M3 8V3h5M9 9 3 3",
|
|
32
|
+
/** lucide: network */
|
|
33
|
+
layout: "M17 16h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1ZM3 16h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1ZM10 2h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1ZM5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3M12 12V8",
|
|
34
|
+
/** lucide: funnel */
|
|
35
|
+
filter: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",
|
|
36
|
+
/** lucide: palette */
|
|
37
|
+
palette: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8zM13 6.5a0.5 0.5 0 1 0 1 0a0.5 0.5 0 1 0 -1 0M17 10.5a0.5 0.5 0 1 0 1 0a0.5 0.5 0 1 0 -1 0M6 12.5a0.5 0.5 0 1 0 1 0a0.5 0.5 0 1 0 -1 0M8 7.5a0.5 0.5 0 1 0 1 0a0.5 0.5 0 1 0 -1 0",
|
|
38
|
+
/** lucide: x */
|
|
39
|
+
close: "M18 6 6 18m6 6 12 12",
|
|
40
|
+
/** lucide: external-link */
|
|
41
|
+
open: "M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",
|
|
42
|
+
/** lucide: grip-vertical */
|
|
43
|
+
grip: "M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0",
|
|
44
|
+
/** lucide: info */
|
|
45
|
+
info: "M2 12a10 10 0 1 0 20 0a10 10 0 1 0 -20 0M12 16v-4M12 8h.01",
|
|
46
|
+
/** lucide: check */
|
|
47
|
+
check: "M20 6 9 17l-5-5",
|
|
48
|
+
/** lucide: percent */
|
|
49
|
+
support: "M19 5L5 19M4 6.5a2.5 2.5 0 1 0 5 0a2.5 2.5 0 1 0 -5 0M15 17.5a2.5 2.5 0 1 0 5 0a2.5 2.5 0 1 0 -5 0",
|
|
50
|
+
/** lucide: bone */
|
|
51
|
+
fossil: "M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z",
|
|
52
|
+
/** lucide: image */
|
|
53
|
+
image: "M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2ZM7 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",
|
|
54
|
+
/** lucide: file-json */
|
|
55
|
+
file: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2zM14 2v5a1 1 0 0 0 1 1h5M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1",
|
|
56
|
+
/** lucide: book-open */
|
|
57
|
+
book: "M12 7v14M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",
|
|
58
|
+
/** lucide: chevron-left */
|
|
59
|
+
previous: "m15 18-6-6 6-6",
|
|
60
|
+
/** lucide: chevron-right */
|
|
61
|
+
next: "m9 18 6-6-6-6",
|
|
62
|
+
/** lucide: dna */
|
|
63
|
+
dna: "m10 16 1.5 1.5m14 8-1.5-1.5M15 2c-1.798 1.998-2.518 3.995-2.807 5.993m16.5 10.5 1 1m17 6-2.891-2.891M2 15c6.667-6 13.333 0 20-6m20 9 .891.891M3.109 14.109 4 15m6.5 12.5 1 1m7 18 2.891 2.891M9 22c1.798-1.998 2.518-3.995 2.807-5.993"
|
|
64
|
+
};
|
|
65
|
+
function Icon({ name, size = 16, className, ...rest }) {
|
|
66
|
+
return /* @__PURE__ */ jsx(
|
|
67
|
+
"svg",
|
|
68
|
+
{
|
|
69
|
+
viewBox: "0 0 24 24",
|
|
70
|
+
width: size,
|
|
71
|
+
height: size,
|
|
72
|
+
fill: "none",
|
|
73
|
+
stroke: "currentColor",
|
|
74
|
+
strokeWidth: 1.75,
|
|
75
|
+
strokeLinecap: "round",
|
|
76
|
+
strokeLinejoin: "round",
|
|
77
|
+
"aria-hidden": "true",
|
|
78
|
+
focusable: "false",
|
|
79
|
+
className: ["ophy-icon", className].filter(Boolean).join(" "),
|
|
80
|
+
...rest,
|
|
81
|
+
children: /* @__PURE__ */ jsx("path", { d: ICON_PATHS[name] })
|
|
82
|
+
}
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export {
|
|
87
|
+
ICON_PATHS,
|
|
88
|
+
Icon
|
|
89
|
+
};
|
package/dist/icons.d.ts
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { SVGProps } from 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The OneOrigin suite's line icons (brand/README.md), the same in OnePedigree, OneTaxonomy and
|
|
6
|
+
* OnePhylogeny: drawings from Lucide (https://lucide.dev, ISC license, © Lucide
|
|
7
|
+
* Contributors), flattened to one path each.
|
|
8
|
+
* 24 × 24, 1.75 stroke, round caps and joins, currentColor. Decorative by default
|
|
9
|
+
* (aria-hidden): put the words in the button's text, or in aria-label plus a
|
|
10
|
+
* visible tooltip (`data-tip`) when the icon stands alone.
|
|
11
|
+
*/
|
|
12
|
+
declare const ICON_PATHS: {
|
|
13
|
+
/** lucide: plus */
|
|
14
|
+
readonly plus: "M5 12h14M12 5v14";
|
|
15
|
+
/** lucide: minus */
|
|
16
|
+
readonly minus: "M5 12h14";
|
|
17
|
+
/** lucide: zoom-in */
|
|
18
|
+
readonly zoomIn: "M3 11a8 8 0 1 0 16 0a8 8 0 1 0 -16 0M21 21L16.65 16.65M11 8L11 14M8 11L14 11";
|
|
19
|
+
/** lucide: zoom-out */
|
|
20
|
+
readonly zoomOut: "M3 11a8 8 0 1 0 16 0a8 8 0 1 0 -16 0M21 21L16.65 16.65M8 11L14 11";
|
|
21
|
+
/** lucide: scan */
|
|
22
|
+
readonly fit: "M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2";
|
|
23
|
+
/** lucide: download */
|
|
24
|
+
readonly download: "M12 15V3M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4m7 10 5 5 5-5";
|
|
25
|
+
/** lucide: printer */
|
|
26
|
+
readonly print: "M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2M6 9V3a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v6M7 14h10a1 1 0 0 1 1 1v6a1 1 0 0 1 -1 1h-10a1 1 0 0 1 -1 -1v-6a1 1 0 0 1 1 -1Z";
|
|
27
|
+
/** lucide: undo-2 */
|
|
28
|
+
readonly undo: "M9 14 4 9l5-5M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11";
|
|
29
|
+
/** lucide: redo-2 */
|
|
30
|
+
readonly redo: "m15 14 5-5-5-5M20 9H9.5A5.5 5.5 0 0 0 4 14.5A5.5 5.5 0 0 0 9.5 20H13";
|
|
31
|
+
/** lucide: chevrons-up-down */
|
|
32
|
+
readonly expand: "m7 15 5 5 5-5m7 9 5-5 5 5";
|
|
33
|
+
/** lucide: chevrons-down-up */
|
|
34
|
+
readonly collapse: "m7 20 5-5 5 5m7 4 5 5 5-5";
|
|
35
|
+
/** lucide: arrow-down-up */
|
|
36
|
+
readonly flip: "m3 16 4 4 4-4M7 20V4m21 8-4-4-4 4M17 4v16";
|
|
37
|
+
/** lucide: focus */
|
|
38
|
+
readonly focus: "M9 12a3 3 0 1 0 6 0a3 3 0 1 0 -6 0M3 7V5a2 2 0 0 1 2-2h2M17 3h2a2 2 0 0 1 2 2v2M21 17v2a2 2 0 0 1-2 2h-2M7 21H5a2 2 0 0 1-2-2v-2";
|
|
39
|
+
/** lucide: expand */
|
|
40
|
+
readonly unfocus: "m15 15 6 6m15 9 6-6M21 16v5h-5M21 8V3h-5M3 16v5h5m3 21 6-6M3 8V3h5M9 9 3 3";
|
|
41
|
+
/** lucide: network */
|
|
42
|
+
readonly layout: "M17 16h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1ZM3 16h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1ZM10 2h4a1 1 0 0 1 1 1v4a1 1 0 0 1 -1 1h-4a1 1 0 0 1 -1 -1v-4a1 1 0 0 1 1 -1ZM5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3M12 12V8";
|
|
43
|
+
/** lucide: funnel */
|
|
44
|
+
readonly filter: "M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z";
|
|
45
|
+
/** lucide: palette */
|
|
46
|
+
readonly palette: "M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8zM13 6.5a0.5 0.5 0 1 0 1 0a0.5 0.5 0 1 0 -1 0M17 10.5a0.5 0.5 0 1 0 1 0a0.5 0.5 0 1 0 -1 0M6 12.5a0.5 0.5 0 1 0 1 0a0.5 0.5 0 1 0 -1 0M8 7.5a0.5 0.5 0 1 0 1 0a0.5 0.5 0 1 0 -1 0";
|
|
47
|
+
/** lucide: x */
|
|
48
|
+
readonly close: "M18 6 6 18m6 6 12 12";
|
|
49
|
+
/** lucide: external-link */
|
|
50
|
+
readonly open: "M15 3h6v6M10 14 21 3M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6";
|
|
51
|
+
/** lucide: grip-vertical */
|
|
52
|
+
readonly grip: "M8 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M8 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M8 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M14 12a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M14 5a1 1 0 1 0 2 0a1 1 0 1 0 -2 0M14 19a1 1 0 1 0 2 0a1 1 0 1 0 -2 0";
|
|
53
|
+
/** lucide: info */
|
|
54
|
+
readonly info: "M2 12a10 10 0 1 0 20 0a10 10 0 1 0 -20 0M12 16v-4M12 8h.01";
|
|
55
|
+
/** lucide: check */
|
|
56
|
+
readonly check: "M20 6 9 17l-5-5";
|
|
57
|
+
/** lucide: percent */
|
|
58
|
+
readonly support: "M19 5L5 19M4 6.5a2.5 2.5 0 1 0 5 0a2.5 2.5 0 1 0 -5 0M15 17.5a2.5 2.5 0 1 0 5 0a2.5 2.5 0 1 0 -5 0";
|
|
59
|
+
/** lucide: bone */
|
|
60
|
+
readonly fossil: "M17 10c.7-.7 1.69 0 2.5 0a2.5 2.5 0 1 0 0-5 .5.5 0 0 1-.5-.5 2.5 2.5 0 1 0-5 0c0 .81.7 1.8 0 2.5l-7 7c-.7.7-1.69 0-2.5 0a2.5 2.5 0 0 0 0 5c.28 0 .5.22.5.5a2.5 2.5 0 1 0 5 0c0-.81-.7-1.8 0-2.5Z";
|
|
61
|
+
/** lucide: image */
|
|
62
|
+
readonly image: "M5 3h14a2 2 0 0 1 2 2v14a2 2 0 0 1 -2 2h-14a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2ZM7 9a2 2 0 1 0 4 0a2 2 0 1 0 -4 0m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21";
|
|
63
|
+
/** lucide: file-json */
|
|
64
|
+
readonly file: "M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2zM14 2v5a1 1 0 0 0 1 1h5M10 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1M14 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1";
|
|
65
|
+
/** lucide: book-open */
|
|
66
|
+
readonly book: "M12 7v14M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z";
|
|
67
|
+
/** lucide: chevron-left */
|
|
68
|
+
readonly previous: "m15 18-6-6 6-6";
|
|
69
|
+
/** lucide: chevron-right */
|
|
70
|
+
readonly next: "m9 18 6-6-6-6";
|
|
71
|
+
/** lucide: dna */
|
|
72
|
+
readonly dna: "m10 16 1.5 1.5m14 8-1.5-1.5M15 2c-1.798 1.998-2.518 3.995-2.807 5.993m16.5 10.5 1 1m17 6-2.891-2.891M2 15c6.667-6 13.333 0 20-6m20 9 .891.891M3.109 14.109 4 15m6.5 12.5 1 1m7 18 2.891 2.891M9 22c1.798-1.998 2.518-3.995 2.807-5.993";
|
|
73
|
+
};
|
|
74
|
+
type IconName = keyof typeof ICON_PATHS;
|
|
75
|
+
declare function Icon({ name, size, className, ...rest }: {
|
|
76
|
+
name: IconName;
|
|
77
|
+
size?: number;
|
|
78
|
+
} & Omit<SVGProps<SVGSVGElement>, 'name'>): react.JSX.Element;
|
|
79
|
+
|
|
80
|
+
export { ICON_PATHS, Icon, type IconName };
|
package/dist/icons.js
ADDED
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { HaplotypeNetwork, Panel, PanelComparison, ClaimReport, RunEvent, FindingStatus, Result, PerWindowReport, StudyOutReport, ValidationReport } from '@extantape/onephylogeny-core';
|
|
3
|
+
|
|
4
|
+
/** The reference categorical palette, validated for colour blindness, in fixed order. Past its end a group goes gray and keeps its label. */
|
|
5
|
+
declare const GROUP_COLORS: string[];
|
|
6
|
+
type Point = {
|
|
7
|
+
x: number;
|
|
8
|
+
y: number;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* A deterministic spring layout: the same network always draws the same way. Edge length follows the number of steps,
|
|
12
|
+
* so distance on the page means something, and nodes repel so labels don't pile up.
|
|
13
|
+
*/
|
|
14
|
+
declare function layoutNetwork(n: Pick<HaplotypeNetwork, 'nodes' | 'edges'>, size?: number): Map<string, Point>;
|
|
15
|
+
/** Scales a layout to fill the frame, keeping `pad` clear on every side so no circle is cut off. */
|
|
16
|
+
declare function fitLayout(pos: Map<string, Point>, size: number, pad: number): Map<string, Point>;
|
|
17
|
+
/**
|
|
18
|
+
* A haplotype network for one window. Circle area is proportional to the number of records, slices show their groups,
|
|
19
|
+
* and links are labelled with steps when more than one. A legend names every group, and a table gives the same numbers.
|
|
20
|
+
*/
|
|
21
|
+
declare function HaplotypeNetworkFigure({ network, panel, size }: {
|
|
22
|
+
network: HaplotypeNetwork;
|
|
23
|
+
panel: Pick<Panel, 'groups'>;
|
|
24
|
+
size?: number;
|
|
25
|
+
}): react.JSX.Element;
|
|
26
|
+
|
|
27
|
+
type Ring = [number, number][];
|
|
28
|
+
type Geometry = {
|
|
29
|
+
type: 'Polygon';
|
|
30
|
+
coordinates: Ring[];
|
|
31
|
+
} | {
|
|
32
|
+
type: 'MultiPolygon';
|
|
33
|
+
coordinates: Ring[][];
|
|
34
|
+
};
|
|
35
|
+
type EcoregionFeature = {
|
|
36
|
+
type: 'Feature';
|
|
37
|
+
properties: {
|
|
38
|
+
ECO_ID: number;
|
|
39
|
+
ECO_NAME: string;
|
|
40
|
+
BIOME_NAME?: string;
|
|
41
|
+
};
|
|
42
|
+
geometry: Geometry | null;
|
|
43
|
+
};
|
|
44
|
+
type Ecoregions = {
|
|
45
|
+
type: 'FeatureCollection';
|
|
46
|
+
features: EcoregionFeature[];
|
|
47
|
+
};
|
|
48
|
+
declare const ECOREGIONS_CREDIT = "Ecoregions: Dinerstein et al. 2017, BioScience 67: 534\u2013545, RESOLVE Ecoregions 2017, CC BY 4.0.";
|
|
49
|
+
/**
|
|
50
|
+
* The region map (roadmap stage 5; owner, 2026-11-10; ADR 0008): each group's ecoregions shaded in its colour, with
|
|
51
|
+
* neighbouring ecoregions in gray for context. Whole ecoregions only, from the panel's tags: never a site or a point.
|
|
52
|
+
* The host passes the outlines (`scripts/ecoregions.mjs`); the credit line is always shown.
|
|
53
|
+
*/
|
|
54
|
+
declare function RegionMap({ panel, ecoregions, width }: {
|
|
55
|
+
panel: Pick<Panel, 'groups'>;
|
|
56
|
+
ecoregions: Ecoregions;
|
|
57
|
+
width?: number;
|
|
58
|
+
}): react.JSX.Element;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* Two panel versions side by side: records that moved, settings that differ, claims that changed and each version's
|
|
62
|
+
* validation outcomes with their intervals. The words come from core, so this and `comparisonMarkdown` say the same.
|
|
63
|
+
* It never combines anything into a score and never says which version is better.
|
|
64
|
+
*/
|
|
65
|
+
declare function ComparisonView({ comparison, initiallyShowSame }: {
|
|
66
|
+
comparison: PanelComparison;
|
|
67
|
+
initiallyShowSame?: boolean;
|
|
68
|
+
}): react.JSX.Element;
|
|
69
|
+
|
|
70
|
+
type Labels = Partial<Record<FindingStatus, string>>;
|
|
71
|
+
declare const statusLabel: (status: FindingStatus, labels?: Labels) => string;
|
|
72
|
+
/** A status always has words and a symbol, never color alone. */
|
|
73
|
+
declare function StatusBadge({ status, labels }: {
|
|
74
|
+
status: FindingStatus;
|
|
75
|
+
labels?: Labels;
|
|
76
|
+
}): react.JSX.Element;
|
|
77
|
+
/** The headline in plain words, including when the honest answer is that nothing can be said. */
|
|
78
|
+
declare function summarizeResult(result: Result, panel: Panel): string;
|
|
79
|
+
/** Coverage across the reference: why a group can or can't be compared with this sample. */
|
|
80
|
+
declare function CoverageBars({ panel, queryAligned, queryLabel }: {
|
|
81
|
+
panel: Panel;
|
|
82
|
+
queryAligned?: string;
|
|
83
|
+
queryLabel?: string;
|
|
84
|
+
}): react.JSX.Element;
|
|
85
|
+
/** Whether this sequence separates each pair of groups. "Not resolved" is a real answer. */
|
|
86
|
+
declare function PairTable({ result, panel }: {
|
|
87
|
+
result: Result;
|
|
88
|
+
panel: Panel;
|
|
89
|
+
}): react.JSX.Element | null;
|
|
90
|
+
/** Everything behind a conclusion: each group, its status, and why. */
|
|
91
|
+
declare function ResultView({ result, panel, queryAligned, labels }: {
|
|
92
|
+
result: Result;
|
|
93
|
+
panel: Panel;
|
|
94
|
+
queryAligned?: string;
|
|
95
|
+
labels?: Labels;
|
|
96
|
+
}): react.JSX.Element;
|
|
97
|
+
/** The calm version for a record page: one conclusion and a link to the detail. */
|
|
98
|
+
declare function LineageCard({ result, panel, marker, title, note, href }: {
|
|
99
|
+
result: Result;
|
|
100
|
+
panel: Panel;
|
|
101
|
+
marker: string;
|
|
102
|
+
title?: string;
|
|
103
|
+
note?: string;
|
|
104
|
+
href?: string;
|
|
105
|
+
}): react.JSX.Element;
|
|
106
|
+
declare function PanelSummary({ panel }: {
|
|
107
|
+
panel: Panel;
|
|
108
|
+
}): react.JSX.Element;
|
|
109
|
+
/** A claim is one pair of groups in one window. Every gate shows, so a failed claim says what stopped it. */
|
|
110
|
+
declare function ClaimsView({ claims, panel }: {
|
|
111
|
+
claims: ClaimReport[];
|
|
112
|
+
panel?: Panel;
|
|
113
|
+
}): react.JSX.Element;
|
|
114
|
+
/** Outcomes by window: holding out each site, and each study (analysis protocol, section 9). */
|
|
115
|
+
declare function OutcomesView({ windows, studyOut, panel }: {
|
|
116
|
+
windows?: PerWindowReport;
|
|
117
|
+
studyOut?: StudyOutReport;
|
|
118
|
+
panel?: Panel;
|
|
119
|
+
}): react.JSX.Element | null;
|
|
120
|
+
declare function ValidationView({ blocks, groups, ladder, claims, panel, windows, studyOut }: {
|
|
121
|
+
blocks: ValidationReport;
|
|
122
|
+
groups: ValidationReport;
|
|
123
|
+
ladder?: ValidationReport[];
|
|
124
|
+
claims?: ClaimReport[];
|
|
125
|
+
panel?: Panel;
|
|
126
|
+
windows?: PerWindowReport;
|
|
127
|
+
studyOut?: StudyOutReport;
|
|
128
|
+
}): react.JSX.Element;
|
|
129
|
+
declare function EventLog({ events }: {
|
|
130
|
+
events: RunEvent[];
|
|
131
|
+
}): react.JSX.Element;
|
|
132
|
+
type TreeNode = {
|
|
133
|
+
label: string;
|
|
134
|
+
length: number;
|
|
135
|
+
children: TreeNode[];
|
|
136
|
+
};
|
|
137
|
+
/** Reads Newick for display only. Science lives elsewhere: a tree exported to OneTaxonomy uses its parser and checks. */
|
|
138
|
+
declare function parseNewickForDisplay(text: string): TreeNode;
|
|
139
|
+
/** A rectangular tree. Support labels stay as the source wrote them, such as 95.1/96. */
|
|
140
|
+
declare function TreeFigure({ newick, labelFor, thresholds }: {
|
|
141
|
+
newick: string;
|
|
142
|
+
labelFor?: (tip: string) => string;
|
|
143
|
+
thresholds?: number[];
|
|
144
|
+
}): react.JSX.Element;
|
|
145
|
+
type LadderStep = {
|
|
146
|
+
taxon: {
|
|
147
|
+
name: string;
|
|
148
|
+
rank: string;
|
|
149
|
+
};
|
|
150
|
+
records: number;
|
|
151
|
+
species: string[];
|
|
152
|
+
sufficient: boolean;
|
|
153
|
+
};
|
|
154
|
+
declare function OutgroupLadderView({ steps, suggested, caveat }: {
|
|
155
|
+
steps: LadderStep[];
|
|
156
|
+
suggested?: string;
|
|
157
|
+
caveat: string;
|
|
158
|
+
}): react.JSX.Element;
|
|
159
|
+
|
|
160
|
+
export { ClaimsView, ComparisonView, CoverageBars, ECOREGIONS_CREDIT, type EcoregionFeature, type Ecoregions, EventLog, GROUP_COLORS, HaplotypeNetworkFigure, type Labels, type LadderStep, LineageCard, OutcomesView, OutgroupLadderView, PairTable, PanelSummary, RegionMap, ResultView, StatusBadge, TreeFigure, type TreeNode, ValidationView, fitLayout, layoutNetwork, parseNewickForDisplay, statusLabel, summarizeResult };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ClaimsView,
|
|
3
|
+
ComparisonView,
|
|
4
|
+
CoverageBars,
|
|
5
|
+
ECOREGIONS_CREDIT,
|
|
6
|
+
EventLog,
|
|
7
|
+
GROUP_COLORS,
|
|
8
|
+
HaplotypeNetworkFigure,
|
|
9
|
+
LineageCard,
|
|
10
|
+
OutcomesView,
|
|
11
|
+
OutgroupLadderView,
|
|
12
|
+
PairTable,
|
|
13
|
+
PanelSummary,
|
|
14
|
+
RegionMap,
|
|
15
|
+
ResultView,
|
|
16
|
+
StatusBadge,
|
|
17
|
+
TreeFigure,
|
|
18
|
+
ValidationView,
|
|
19
|
+
fitLayout,
|
|
20
|
+
layoutNetwork,
|
|
21
|
+
parseNewickForDisplay,
|
|
22
|
+
statusLabel,
|
|
23
|
+
summarizeResult
|
|
24
|
+
} from "./chunk-RIXPX6T6.js";
|
|
25
|
+
export {
|
|
26
|
+
ClaimsView,
|
|
27
|
+
ComparisonView,
|
|
28
|
+
CoverageBars,
|
|
29
|
+
ECOREGIONS_CREDIT,
|
|
30
|
+
EventLog,
|
|
31
|
+
GROUP_COLORS,
|
|
32
|
+
HaplotypeNetworkFigure,
|
|
33
|
+
LineageCard,
|
|
34
|
+
OutcomesView,
|
|
35
|
+
OutgroupLadderView,
|
|
36
|
+
PairTable,
|
|
37
|
+
PanelSummary,
|
|
38
|
+
RegionMap,
|
|
39
|
+
ResultView,
|
|
40
|
+
StatusBadge,
|
|
41
|
+
TreeFigure,
|
|
42
|
+
ValidationView,
|
|
43
|
+
fitLayout,
|
|
44
|
+
layoutNetwork,
|
|
45
|
+
parseNewickForDisplay,
|
|
46
|
+
statusLabel,
|
|
47
|
+
summarizeResult
|
|
48
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,67 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@extantape/onephylogeny-react",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0-alpha.9",
|
|
4
|
+
"description": "OnePhylogeny for React: server-renderable views of sample results, panel coverage, validation, run logs, outgroup suggestions and a compact lineage card.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"phylogenetics",
|
|
7
|
+
"react",
|
|
8
|
+
"reference-panel"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://github.com/ExtantApe/OnePhylogeny#readme",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/ExtantApe/OnePhylogeny/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/ExtantApe/OnePhylogeny.git",
|
|
18
|
+
"directory": "packages/react"
|
|
19
|
+
},
|
|
20
|
+
"type": "module",
|
|
21
|
+
"sideEffects": [
|
|
22
|
+
"*.css"
|
|
23
|
+
],
|
|
24
|
+
"exports": {
|
|
25
|
+
".": {
|
|
26
|
+
"types": "./dist/index.d.ts",
|
|
27
|
+
"import": "./dist/index.js"
|
|
28
|
+
},
|
|
29
|
+
"./canvas": {
|
|
30
|
+
"types": "./dist/canvas.d.ts",
|
|
31
|
+
"import": "./dist/canvas.js"
|
|
32
|
+
},
|
|
33
|
+
"./icons": {
|
|
34
|
+
"types": "./dist/icons.d.ts",
|
|
35
|
+
"import": "./dist/icons.js"
|
|
36
|
+
},
|
|
37
|
+
"./styles.css": "./src/styles.css"
|
|
38
|
+
},
|
|
39
|
+
"main": "./dist/index.js",
|
|
40
|
+
"types": "./dist/index.d.ts",
|
|
41
|
+
"files": [
|
|
42
|
+
"dist",
|
|
43
|
+
"src/styles.css",
|
|
44
|
+
"README.md",
|
|
45
|
+
"LICENSE"
|
|
46
|
+
],
|
|
47
|
+
"engines": {
|
|
48
|
+
"node": ">=22"
|
|
49
|
+
},
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@extantape/onephylogeny-core": "^0.1.0-alpha.9"
|
|
52
|
+
},
|
|
53
|
+
"peerDependencies": {
|
|
54
|
+
"react": "^19"
|
|
55
|
+
},
|
|
56
|
+
"devDependencies": {
|
|
57
|
+
"@types/react": "^19",
|
|
58
|
+
"@types/react-dom": "^19",
|
|
59
|
+
"react": "^19",
|
|
60
|
+
"react-dom": "^19"
|
|
61
|
+
},
|
|
62
|
+
"scripts": {
|
|
63
|
+
"build": "tsup src/index.tsx src/canvas.tsx src/icons.tsx --format esm --dts --clean --target es2022 --external react",
|
|
64
|
+
"typecheck": "tsc --noEmit",
|
|
65
|
+
"test": "vitest run"
|
|
66
|
+
}
|
|
6
67
|
}
|
package/src/styles.css
ADDED
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
.ophy-muted { color: var(--ophy-muted, #5b6577); font-size: 0.92em; }
|
|
2
|
+
.ophy-warning { color: var(--ophy-warning, #8a5a14); }
|
|
3
|
+
.ophy-table { border-collapse: collapse; width: 100%; font-size: 13px; margin: 8px 0; }
|
|
4
|
+
.ophy-table th, .ophy-table td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--ophy-border, #eaddd6); vertical-align: top; font-weight: 400; }
|
|
5
|
+
.ophy-table thead th { font-weight: 600; color: var(--ophy-muted, #5b6577); }
|
|
6
|
+
.ophy-table tbody th { font-weight: 600; }
|
|
7
|
+
.ophy-status { display: inline-block; white-space: nowrap; padding: 1px 8px; border-radius: 999px; border: 1px solid currentColor; font-size: 12px; }
|
|
8
|
+
.ophy-status-consistent { color: var(--ophy-good, #1d6b47); }
|
|
9
|
+
.ophy-status-excluded_within_panel { color: var(--ophy-muted, #5b6577); }
|
|
10
|
+
.ophy-status-not_evaluable { color: var(--ophy-muted, #5b6577); border-style: dashed; }
|
|
11
|
+
.ophy-status-inconclusive { color: var(--ophy-warning, #8a5a14); }
|
|
12
|
+
.ophy-coverage { width: 100%; max-width: 760px; display: block; margin: 8px 0; }
|
|
13
|
+
.ophy-coverage-label { font-size: 12px; fill: currentColor; }
|
|
14
|
+
.ophy-coverage-axis { font-size: 10px; fill: var(--ophy-muted, #5b6577); }
|
|
15
|
+
.ophy-coverage-track { fill: var(--ophy-border, #eaddd6); opacity: 0.5; }
|
|
16
|
+
.ophy-coverage-group { fill: var(--ophy-ink, #91645d); }
|
|
17
|
+
.ophy-coverage-query { fill: var(--ophy-accent, #cf8137); }
|
|
18
|
+
.ophy-caveats { margin: 4px 0; padding-inline-start: 18px; font-size: 13px; }
|
|
19
|
+
.ophy-card { border: 1px solid var(--ophy-border, #eaddd6); border-radius: 10px; padding: 12px 14px; max-width: 440px; }
|
|
20
|
+
.ophy-card-title { font-size: 12px; color: var(--ophy-muted, #5b6577); }
|
|
21
|
+
.ophy-card-value { font-size: 17px; font-weight: 600; margin: 2px 0 6px; }
|
|
22
|
+
.ophy-log { list-style: none; margin: 0; padding: 8px; font: 12px/1.5 ui-monospace, Menlo, monospace; max-height: 260px; overflow: auto; border: 1px solid var(--ophy-border, #eaddd6); border-radius: 8px; }
|
|
23
|
+
.ophy-log time, .ophy-log-step { color: var(--ophy-muted, #5b6577); }
|
|
24
|
+
.ophy-log-warning { color: var(--ophy-warning, #8a5a14); }
|
|
25
|
+
.ophy-log-error { color: var(--ophy-flag, #a23a3d); font-weight: 600; }
|
|
26
|
+
.ophy-tree { width: 100%; display: block; color: inherit; }
|
|
27
|
+
.ophy-tree-edge { fill: none; stroke: var(--ophy-ink, #91645d); stroke-width: 1.2; }
|
|
28
|
+
.ophy-tree-tip { font-size: 11px; fill: currentColor; }
|
|
29
|
+
.ophy-tree-support { font-size: 8.5px; fill: var(--ophy-muted, #5b6577); }
|
|
30
|
+
.ophy-tree-supported { fill: var(--ophy-good, #1d6b47); font-weight: 700; }
|
|
31
|
+
.ophy-ladder { padding-inline-start: 20px; margin: 6px 0; }
|
|
32
|
+
.ophy-ladder-suggested { font-weight: 600; }
|
|
33
|
+
/* Tree canvas and floating toolbar, as in OnePedigree and OneTaxonomy. */
|
|
34
|
+
.ophy-icon { flex: none; }
|
|
35
|
+
.ophy-canvas { position: relative; overflow: hidden; touch-action: none; cursor: grab; border: 1px solid var(--ophy-border, #eaddd6); border-radius: 10px; }
|
|
36
|
+
.ophy-canvas:active { cursor: grabbing; }
|
|
37
|
+
/* Focus ring: --ophy-focus, the darker orange on light backgrounds (brand/README.md, owner decision); set it to #e7a066 in dark themes. */
|
|
38
|
+
.ophy-canvas:focus-visible { outline: 2px solid var(--ophy-focus, #a65f20); outline-offset: 1px; }
|
|
39
|
+
.ophy-canvas-content { transform-origin: 0 0; will-change: transform; }
|
|
40
|
+
.ophy-floating { position: absolute; top: 8px; right: 8px; z-index: 1; display: flex; gap: 4px; }
|
|
41
|
+
.ophy-floating button { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 8px; cursor: pointer; }
|
|
42
|
+
.ophy-floating [data-tip] { position: relative; }
|
|
43
|
+
.ophy-floating [data-tip]:is(:hover, :focus-visible)::after {
|
|
44
|
+
content: attr(data-tip); position: absolute; top: calc(100% + 6px); right: 0; z-index: 2; white-space: nowrap; pointer-events: none;
|
|
45
|
+
padding: 4px 8px; border-radius: 6px; background: var(--ophy-ink, #91645d); color: #fff; font-size: 12px; line-height: 1.3;
|
|
46
|
+
}
|
|
47
|
+
@media print {
|
|
48
|
+
html[data-ophy-printing] body * { visibility: hidden; }
|
|
49
|
+
html[data-ophy-printing] .ophy-canvas, html[data-ophy-printing] .ophy-canvas * { visibility: visible; }
|
|
50
|
+
html[data-ophy-printing] .ophy-canvas { position: absolute; inset: 0; height: auto !important; overflow: visible; border: 0; }
|
|
51
|
+
html[data-ophy-printing] .ophy-canvas-content { transform: none !important; }
|
|
52
|
+
.ophy-floating { display: none; }
|
|
53
|
+
}
|
|
54
|
+
.ophy-network svg { width: 100%; max-width: 560px; display: block; }
|
|
55
|
+
.ophy-net-edge { stroke: var(--ophy-muted, #5b6577); stroke-width: 2; }
|
|
56
|
+
.ophy-net-steps { font-size: 11px; fill: var(--ophy-muted, #5b6577); }
|
|
57
|
+
.ophy-net-ring { fill: var(--ophy-surface, #fff); }
|
|
58
|
+
.ophy-legend { list-style: none; display: flex; flex-wrap: wrap; gap: 12px; padding: 0; margin: 0 0 8px; font-size: 13px; }
|
|
59
|
+
.ophy-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: baseline; }
|
|
60
|
+
.ophy-regionmap svg { width: 100%; max-width: 600px; display: block; }
|
|
61
|
+
.ophy-map-context { fill: var(--ophy-border, #eaddd6); stroke: var(--ophy-surface, #fff); stroke-width: 0.6; }
|
|
62
|
+
.ophy-map-region { stroke: var(--ophy-surface, #fff); stroke-width: 1; }
|
|
63
|
+
.ophy-map-shared { stroke: #1a1a1a; stroke-width: 1.6; }
|