@captiveorigins/onepedigree-react 0.1.0-alpha.10 → 0.1.0-alpha.12
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 -21
- package/README.md +1 -1
- package/THIRD-PARTY-LICENSE-LUCIDE.txt +43 -0
- package/dist/PedigreeExplorer.js +1 -1
- package/dist/genetics.d.ts +2 -0
- package/dist/genetics.js +3 -3
- package/dist/styles.css +11 -6
- package/package.json +5 -4
package/LICENSE
CHANGED
|
@@ -1,21 +1,75 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
1
|
+
Required Notice: Copyright 2026 Captive Origins (https://captiveorigins.com)
|
|
2
|
+
|
|
3
|
+
# PolyForm Noncommercial License 1.0.0
|
|
4
|
+
|
|
5
|
+
<https://polyformproject.org/licenses/noncommercial/1.0.0>
|
|
6
|
+
|
|
7
|
+
## Acceptance
|
|
8
|
+
|
|
9
|
+
In order to get any license under these terms, you must agree to them as both strict obligations and conditions to all your licenses.
|
|
10
|
+
|
|
11
|
+
## Copyright License
|
|
12
|
+
|
|
13
|
+
The licensor grants you a copyright license for the software to do everything you might do with the software that would otherwise infringe the licensor's copyright in it for any permitted purpose. However, you may only distribute the software according to [Distribution License](#distribution-license) and make changes or new works based on the software according to [Changes and New Works License](#changes-and-new-works-license).
|
|
14
|
+
|
|
15
|
+
## Distribution License
|
|
16
|
+
|
|
17
|
+
The licensor grants you an additional copyright license to distribute copies of the software. Your license to distribute covers distributing the software with changes and new works permitted by [Changes and New Works License](#changes-and-new-works-license).
|
|
18
|
+
|
|
19
|
+
## Notices
|
|
20
|
+
|
|
21
|
+
You must ensure that anyone who gets a copy of any part of the software from you also gets a copy of these terms or the URL for them above, as well as copies of any plain-text lines beginning with `Required Notice:` that the licensor provided with the software. For example:
|
|
22
|
+
|
|
23
|
+
> Required Notice: Copyright Yoyodyne, Inc. (http://example.com)
|
|
24
|
+
|
|
25
|
+
## Changes and New Works License
|
|
26
|
+
|
|
27
|
+
The licensor grants you an additional copyright license to make changes and new works based on the software for any permitted purpose.
|
|
28
|
+
|
|
29
|
+
## Patent License
|
|
30
|
+
|
|
31
|
+
The licensor grants you a patent license for the software that covers patent claims the licensor can license, or becomes able to license, that you would infringe by using the software.
|
|
32
|
+
|
|
33
|
+
## Noncommercial Purposes
|
|
34
|
+
|
|
35
|
+
Any noncommercial purpose is a permitted purpose.
|
|
36
|
+
|
|
37
|
+
## Personal Uses
|
|
38
|
+
|
|
39
|
+
Personal use for research, experiment, and testing for the benefit of public knowledge, personal study, private entertainment, hobby projects, amateur pursuits, or religious observance, without any anticipated commercial application, is use for a permitted purpose.
|
|
40
|
+
|
|
41
|
+
## Noncommercial Organizations
|
|
42
|
+
|
|
43
|
+
Use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization, or government institution is use for a permitted purpose regardless of the source of funding or obligations resulting from the funding.
|
|
44
|
+
|
|
45
|
+
## Fair Use
|
|
46
|
+
|
|
47
|
+
You may have "fair use" rights for the software under the law. These terms do not limit them.
|
|
48
|
+
|
|
49
|
+
## No Other Rights
|
|
50
|
+
|
|
51
|
+
These terms do not allow you to sublicense or transfer any of your licenses to anyone else, or prevent the licensor from granting licenses to anyone else. These terms do not imply any other licenses.
|
|
52
|
+
|
|
53
|
+
## Patent Defense
|
|
54
|
+
|
|
55
|
+
If you make any written claim that the software infringes or contributes to infringement of any patent, your patent license for the software granted under these terms ends immediately. If your company makes such a claim, your patent license ends immediately for work on behalf of your company.
|
|
56
|
+
|
|
57
|
+
## Violations
|
|
58
|
+
|
|
59
|
+
The first time you are notified in writing that you have violated any of these terms, or done anything with the software not covered by your licenses, your licenses can nonetheless continue if you come into full compliance with these terms, and take practical steps to correct past violations, within 32 days of receiving notice. Otherwise, all your licenses end immediately.
|
|
60
|
+
|
|
61
|
+
## No Liability
|
|
62
|
+
|
|
63
|
+
***As far as the law allows, the software comes as is, without any warranty or condition, and the licensor will not be liable to you for any damages arising out of these terms or the use or nature of the software, under any kind of legal claim.***
|
|
64
|
+
|
|
65
|
+
## Definitions
|
|
66
|
+
|
|
67
|
+
The **licensor** is the individual or entity offering these terms, and the **software** is the software the licensor makes available under these terms.
|
|
68
|
+
|
|
69
|
+
**You** refers to the individual or entity agreeing to these terms.
|
|
70
|
+
|
|
71
|
+
**Your company** is any legal entity, sole proprietorship, or other kind of organization that you work for, plus all organizations that have control over, are under the control of, or are under common control with that organization. **Control** means ownership of substantially all the assets of an entity, or the power to direct its management and policies by vote, contract, or otherwise. Control can be direct or indirect.
|
|
72
|
+
|
|
73
|
+
**Your licenses** are all the licenses granted to you for the software under these terms.
|
|
74
|
+
|
|
75
|
+
**Use** means anything you do with the software requiring one of your licenses.
|
package/README.md
CHANGED
|
@@ -85,4 +85,4 @@ patterns per reproductive mode, and a ↻ marker plus dashed border on repeated
|
|
|
85
85
|
|
|
86
86
|
## License
|
|
87
87
|
|
|
88
|
-
MIT
|
|
88
|
+
[PolyForm Noncommercial 1.0.0](https://polyformproject.org/licenses/noncommercial/1.0.0). Free for noncommercial use, with attribution; commercial use needs a separate license from Captive Origins. Versions published before this change remain under MIT.
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Lucide Icons and Contributors
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
10
|
+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
11
|
+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
12
|
+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
13
|
+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
14
|
+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
15
|
+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
16
|
+
|
|
17
|
+
---
|
|
18
|
+
|
|
19
|
+
The following Lucide icons are derived from the Feather project:
|
|
20
|
+
|
|
21
|
+
airplay, alert-circle, alert-octagon, alert-triangle, aperture, arrow-down-circle, arrow-down-left, arrow-down-right, arrow-down, arrow-left-circle, arrow-left, arrow-right-circle, arrow-right, arrow-up-circle, arrow-up-left, arrow-up-right, arrow-up, at-sign, calendar, cast, check, chevron-down, chevron-left, chevron-right, chevron-up, chevrons-down, chevrons-left, chevrons-right, chevrons-up, circle, clipboard, clock, code, columns, command, compass, corner-down-left, corner-down-right, corner-left-down, corner-left-up, corner-right-down, corner-right-up, corner-up-left, corner-up-right, crosshair, database, divide-circle, divide-square, dollar-sign, download, external-link, feather, frown, hash, headphones, help-circle, info, italic, key, layout, life-buoy, link-2, link, loader, lock, log-in, log-out, maximize, meh, minimize, minimize-2, minus-circle, minus-square, minus, monitor, moon, more-horizontal, more-vertical, move, music, navigation-2, navigation, octagon, pause-circle, percent, plus-circle, plus-square, plus, power, radio, rss, search, server, share, shopping-bag, sidebar, smartphone, smile, square, table-2, tablet, target, terminal, trash-2, trash, triangle, tv, type, upload, x-circle, x-octagon, x-square, x, zoom-in, zoom-out
|
|
22
|
+
|
|
23
|
+
The MIT License (MIT) (for the icons listed above)
|
|
24
|
+
|
|
25
|
+
Copyright (c) 2013-present Cole Bemis
|
|
26
|
+
|
|
27
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
28
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
29
|
+
in the Software without restriction, including without limitation the rights
|
|
30
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
31
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
32
|
+
furnished to do so, subject to the following conditions:
|
|
33
|
+
|
|
34
|
+
The above copyright notice and this permission notice shall be included in all
|
|
35
|
+
copies or substantial portions of the Software.
|
|
36
|
+
|
|
37
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
38
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
39
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
40
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
41
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
42
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
43
|
+
SOFTWARE.
|
package/dist/PedigreeExplorer.js
CHANGED
|
@@ -234,7 +234,7 @@ export function PedigreeExplorer(props) {
|
|
|
234
234
|
const individual = occurrence ? projection.individuals[occurrence.individualId] : undefined;
|
|
235
235
|
const href = individual ? (props.getIndividualHref?.(individual) ?? null) : null;
|
|
236
236
|
const close = () => choose(null);
|
|
237
|
-
return (_jsxs("div", { ref: root, className: "op-explorer", style: { height: props.height ?? '32rem', ...(theme ? { ...themeStyle(theme, projection.view), background: 'var(--op-background)' } : {}) }, onKeyDown: onKeyDown, onWheel: onWheel, onPointerDown: onPointerDown, onPointerMove: onPointerMove, onPointerUp: onPointerUp, onPointerCancel: onPointerCancel, onClickCapture: (e) => {
|
|
237
|
+
return (_jsxs("div", { ref: root, className: "op-explorer", "data-legend": props.geneOverlay || props.genotypes ? '' : undefined, style: { height: props.height ?? '32rem', ...(theme ? { ...themeStyle(theme, projection.view), background: 'var(--op-background)' } : {}) }, onKeyDown: onKeyDown, onWheel: onWheel, onPointerDown: onPointerDown, onPointerMove: onPointerMove, onPointerUp: onPointerUp, onPointerCancel: onPointerCancel, onClickCapture: (e) => {
|
|
238
238
|
// A drag ends with a click on the node: don't let it select.
|
|
239
239
|
if (suppressClick.current) {
|
|
240
240
|
suppressClick.current = false;
|
package/dist/genetics.d.ts
CHANGED
|
@@ -39,6 +39,8 @@ export type GenotypeDisplay = {
|
|
|
39
39
|
records: ReadonlyMap<string, readonly GenotypeRecord[]>;
|
|
40
40
|
/** Needed for sex-linked genes: the heterogametic sex has one copy (one dot). */
|
|
41
41
|
sexOf?: (individualId: string) => SexClass;
|
|
42
|
+
/** Words for the key (translations). */
|
|
43
|
+
labels?: Partial<Record<'title' | 'two' | 'one' | 'none' | 'possible' | 'unknown' | 'suggested', string>>;
|
|
42
44
|
};
|
|
43
45
|
/** Allele dots for one gene (SVG, starting at 0,0, vertically centered on 0). */
|
|
44
46
|
export declare function GenotypeDots({ gene, record, hemizygous, r, words }: {
|
package/dist/genetics.js
CHANGED
|
@@ -51,8 +51,8 @@ function copies(record, mode, slots) {
|
|
|
51
51
|
return { filled: 1, possible: 0, unknown: 0 };
|
|
52
52
|
if (state === 'super')
|
|
53
53
|
return { filled: slots, possible: 0, unknown: 0 };
|
|
54
|
-
// visual: two copies for a recessive (or one when hemizygous); one
|
|
55
|
-
return
|
|
54
|
+
// visual: two copies for a recessive (or one when hemizygous); otherwise at least one, the other not known
|
|
55
|
+
return slots === 1 || mode === 'recessive' ? { filled: slots, possible: 0, unknown: 0 } : { filled: 1, possible: 0, unknown: 1 };
|
|
56
56
|
}
|
|
57
57
|
/** Allele dots for one gene (SVG, starting at 0,0, vertically centered on 0). */
|
|
58
58
|
export function GenotypeDots({ gene, record, hemizygous = false, r = 4.5, words }) {
|
|
@@ -88,7 +88,7 @@ export function genotypeText(display, individualId, words = GENOTYPE_WORDS) {
|
|
|
88
88
|
.join('; ');
|
|
89
89
|
}
|
|
90
90
|
/** Key for allele dots: each gene's color, and what the dots mean. */
|
|
91
|
-
export function GenotypeKey({ display, labels = {} }) {
|
|
91
|
+
export function GenotypeKey({ display, labels = display.labels ?? {} }) {
|
|
92
92
|
const l = { title: 'Genes', two: 'two copies', one: 'one copy', none: 'none', possible: 'possible (dashed)', unknown: 'not known', suggested: 'suggested from relatives', ...labels };
|
|
93
93
|
const demo = { id: 'demo', label: '', color: '#7a625c', mode: 'recessive' };
|
|
94
94
|
const sample = (record, text) => (_jsxs("li", { children: [_jsx("svg", { width: 22, height: 12, viewBox: "0 -6 22 12", "aria-hidden": "true", children: _jsx(GenotypeDots, { gene: demo, record: record, r: 4 }) }), text] }));
|
package/dist/styles.css
CHANGED
|
@@ -142,11 +142,11 @@
|
|
|
142
142
|
}
|
|
143
143
|
|
|
144
144
|
/* Heritable trait overlay: genetic pedigree symbols (filled = visual, half = het, dot = possible het, open = not carrying). */
|
|
145
|
-
.op-gene-outline { fill: var(--op-node-background); stroke: var(--op-label); stroke-width: 1.5px; }
|
|
145
|
+
.op-gene-outline { fill: var(--op-node-background, #fff); stroke: var(--op-label, #4c312c); stroke-width: 1.5px; }
|
|
146
146
|
.op-gene-outline[data-dashed] { stroke-dasharray: 2 2; }
|
|
147
|
-
.op-gene-fill { fill: var(--op-label); }
|
|
148
|
-
.op-gene-ring { fill: none; stroke: var(--op-label); stroke-width: 1.25px; }
|
|
149
|
-
.op-gene-text { font-size: 9px; fill: var(--op-label); }
|
|
147
|
+
.op-gene-fill { fill: var(--op-label, #4c312c); }
|
|
148
|
+
.op-gene-ring { fill: none; stroke: var(--op-label, #4c312c); stroke-width: 1.25px; }
|
|
149
|
+
.op-gene-text { font-size: 9px; fill: var(--op-label, #4c312c); }
|
|
150
150
|
.op-gene[data-state='unknown'] .op-gene-outline { stroke: #9a8f8b; }
|
|
151
151
|
.op-gene[data-state='unknown'] .op-gene-text { fill: #9a8f8b; }
|
|
152
152
|
.op-gene-legends { position: absolute; left: 8px; bottom: 8px; z-index: 1; max-width: calc(100% - 16px); display: flex; flex-wrap: wrap; gap: 6px; align-items: flex-end; }
|
|
@@ -162,10 +162,15 @@
|
|
|
162
162
|
|
|
163
163
|
/* Allele dots: two per gene, one per copy. Filled = carries it (gene color), empty = normal copy,
|
|
164
164
|
dashed = possible, grey dashed = not known. Shape carries the meaning, not color. */
|
|
165
|
-
.op-dot { fill: var(--op-node-background); stroke: var(--op-label); stroke-width: 1.25px; }
|
|
165
|
+
.op-dot { fill: var(--op-node-background, #fff); stroke: var(--op-label, #4c312c); stroke-width: 1.25px; }
|
|
166
166
|
.op-dot[data-dot='possible'] { stroke-dasharray: 1.6 1.6; }
|
|
167
167
|
/* Suggested from relatives (not proven): the copy is drawn with a dashed edge. */
|
|
168
168
|
.op-dot[data-inferred] { stroke-dasharray: 2 1.4; stroke-width: 1.5px; }
|
|
169
169
|
.op-dot[data-dot='unknown'] { stroke: #9a8f8b; stroke-dasharray: 1.6 1.6; }
|
|
170
|
-
.op-gene-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--op-label); }
|
|
170
|
+
.op-gene-swatch { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 1px solid var(--op-label, #4c312c); }
|
|
171
171
|
.op-genotype-key ul + ul { margin-top: 2px; }
|
|
172
|
+
|
|
173
|
+
/* With a gene legend, the legend sits under the drawing instead of covering it. */
|
|
174
|
+
.op-explorer[data-legend] { display: flex; flex-direction: column; }
|
|
175
|
+
.op-explorer[data-legend] > svg { flex: 1; min-height: 0; height: auto; }
|
|
176
|
+
.op-explorer[data-legend] .op-gene-legends { position: static; margin: 0 8px 8px; max-width: none; }
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@captiveorigins/onepedigree-react",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.12",
|
|
4
4
|
"description": "OnePedigree for React: server-renderable SVG pedigree views (all 13), an interactive explorer, headless hooks and CSS-variable styling.",
|
|
5
5
|
"homepage": "https://github.com/mgilardi/onepedigree#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"svg",
|
|
15
15
|
"breeding"
|
|
16
16
|
],
|
|
17
|
-
"license": "
|
|
17
|
+
"license": "PolyForm-Noncommercial-1.0.0",
|
|
18
18
|
"repository": {
|
|
19
19
|
"type": "git",
|
|
20
20
|
"url": "git+https://github.com/mgilardi/onepedigree.git",
|
|
@@ -40,13 +40,14 @@
|
|
|
40
40
|
"files": [
|
|
41
41
|
"dist",
|
|
42
42
|
"README.md",
|
|
43
|
-
"LICENSE"
|
|
43
|
+
"LICENSE",
|
|
44
|
+
"THIRD-PARTY-LICENSE-LUCIDE.txt"
|
|
44
45
|
],
|
|
45
46
|
"engines": {
|
|
46
47
|
"node": ">=22"
|
|
47
48
|
},
|
|
48
49
|
"dependencies": {
|
|
49
|
-
"@captiveorigins/onepedigree-core": "^0.1.0-alpha.
|
|
50
|
+
"@captiveorigins/onepedigree-core": "^0.1.0-alpha.12"
|
|
50
51
|
},
|
|
51
52
|
"peerDependencies": {
|
|
52
53
|
"react": ">=18.2"
|