compasso 0.2.0 → 0.3.0
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 +70 -7
- package/dist/chunk-F47C6ZEB.js +1041 -0
- package/dist/chunk-F47C6ZEB.js.map +1 -0
- package/dist/chunk-JP4N42AY.js +497 -0
- package/dist/chunk-JP4N42AY.js.map +1 -0
- package/dist/{chunk-P2S7AUOL.js → chunk-LRHHUJFZ.js} +3 -3
- package/dist/{chunk-P2S7AUOL.js.map → chunk-LRHHUJFZ.js.map} +1 -1
- package/dist/{chunk-5B453C4P.js → chunk-O3BT2O42.js} +32 -3
- package/dist/chunk-O3BT2O42.js.map +1 -0
- package/dist/{chunk-EHQMKVDM.js → chunk-Q6DVTCXD.js} +9 -24
- package/dist/chunk-Q6DVTCXD.js.map +1 -0
- package/dist/{chunk-5PGOL2KR.js → chunk-RWPGGWO5.js} +9 -28
- package/dist/chunk-RWPGGWO5.js.map +1 -0
- package/dist/{chunk-TP3JOOJW.js → chunk-ZBDABVIO.js} +3 -3
- package/dist/{chunk-TP3JOOJW.js.map → chunk-ZBDABVIO.js.map} +1 -1
- package/dist/core/index.cjs +30 -0
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +5 -1
- package/dist/core/index.d.ts +5 -1
- package/dist/core/index.js +1 -1
- package/dist/ecomap/index.cjs +32 -21
- package/dist/ecomap/index.cjs.map +1 -1
- package/dist/ecomap/index.js +2 -2
- package/dist/fault-tree/index.js +2 -2
- package/dist/fishbone/index.js +2 -2
- package/dist/genogram/index.cjs +36 -25
- package/dist/genogram/index.cjs.map +1 -1
- package/dist/genogram/index.d.cts +4 -2
- package/dist/genogram/index.d.ts +4 -2
- package/dist/genogram/index.js +2 -2
- package/dist/index.cjs +1616 -53
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -2
- package/dist/index.d.ts +7 -2
- package/dist/index.js +7 -5
- package/dist/kinship-DqEklrDN.d.ts +51 -0
- package/dist/kinship-Dy_ijjJV.d.cts +51 -0
- package/dist/labels-CBQ_3Ec9.d.cts +123 -0
- package/dist/labels-DNqRkWuI.d.ts +123 -0
- package/dist/labels-iZjijjtK.d.cts +64 -0
- package/dist/labels-iZjijjtK.d.ts +64 -0
- package/dist/locales/pt-br.cjs +58 -0
- package/dist/locales/pt-br.cjs.map +1 -1
- package/dist/locales/pt-br.d.cts +9 -2
- package/dist/locales/pt-br.d.ts +9 -2
- package/dist/locales/pt-br.js +55 -1
- package/dist/locales/pt-br.js.map +1 -1
- package/dist/pedigree/index.cjs +1151 -0
- package/dist/pedigree/index.cjs.map +1 -0
- package/dist/pedigree/index.d.cts +155 -0
- package/dist/pedigree/index.d.ts +155 -0
- package/dist/pedigree/index.js +4 -0
- package/dist/pedigree/index.js.map +1 -0
- package/dist/phylo/index.cjs +553 -0
- package/dist/phylo/index.cjs.map +1 -0
- package/dist/phylo/index.d.cts +158 -0
- package/dist/phylo/index.d.ts +158 -0
- package/dist/phylo/index.js +4 -0
- package/dist/phylo/index.js.map +1 -0
- package/dist/types-BnMG7TCd.d.cts +66 -0
- package/dist/types-BnMG7TCd.d.ts +66 -0
- package/package.json +34 -12
- package/dist/chunk-5B453C4P.js.map +0 -1
- package/dist/chunk-5PGOL2KR.js.map +0 -1
- package/dist/chunk-EHQMKVDM.js.map +0 -1
- package/dist/kinship-BARO5-qz.d.cts +0 -115
- package/dist/kinship-Bkf87Jhu.d.ts +0 -115
package/README.md
CHANGED
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Standards-faithful technical diagrams as **pure SVG strings**. Deterministic, zero
|
|
4
4
|
runtime dependencies, server-safe (no DOM, no canvas, no clock, no randomness).
|
|
5
5
|
|
|
6
|
-
**
|
|
6
|
+
**Six diagrams shipped:** the **genogram** (McGoldrick family-systems notation), the
|
|
7
7
|
**ecomap** (radial person↔environment ties), the **fault tree** (NUREG-0492 / IEC 61025
|
|
8
|
-
distinctive-shape notation)
|
|
9
|
-
|
|
8
|
+
distinctive-shape notation), the **fishbone** (Ishikawa cause-and-effect), the
|
|
9
|
+
**pedigree** (Bennett 2008 standardized clinical-genetics nomenclature) and the
|
|
10
|
+
**phylogenetic tree** (cladogram + phylogram). The architecture is built for more —
|
|
11
|
+
see the roadmap.
|
|
10
12
|
|
|
11
13
|
## Principles
|
|
12
14
|
|
|
@@ -139,6 +141,61 @@ effect at every level (suppressible via `arrowheads: false`). **Declared order i
|
|
|
139
141
|
honored** — significance-near-the-head is the analyst's call, never re-sorted. Label
|
|
140
142
|
spacing is driven by measured text widths, so labels never collide.
|
|
141
143
|
|
|
144
|
+
## Pedigree
|
|
145
|
+
|
|
146
|
+
```ts
|
|
147
|
+
import { pedigreeSvg } from "compasso/pedigree";
|
|
148
|
+
|
|
149
|
+
const { svg } = pedigreeSvg({
|
|
150
|
+
conditions: [{ id: 1, label: "Cystic fibrosis" }],
|
|
151
|
+
individuals: [
|
|
152
|
+
{ id: 1, label: "I-1", sex: "male", generation: 1, deceased: true, carrier: true, role: null, lifeStatus: "alive", affectedBy: [] },
|
|
153
|
+
{ id: 2, label: "I-2", sex: "female", generation: 1, deceased: false, carrier: true, role: null, lifeStatus: "alive", affectedBy: [] },
|
|
154
|
+
{ id: 3, label: "II-1", sex: "female", generation: 2, deceased: false, carrier: false, role: "proband", lifeStatus: "alive", affectedBy: [1] },
|
|
155
|
+
],
|
|
156
|
+
matings: [{ id: 1, partnerAId: 1, partnerBId: 2, consanguineous: false }],
|
|
157
|
+
sibships: [{ id: 1, matingId: 1, childIds: [3], twinGroups: [] }],
|
|
158
|
+
});
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
Standardized clinical-genetics notation (Bennett et al. 2008): square/circle/diamond by
|
|
162
|
+
sex, **filled glyph = affected** (multiple conditions shown as up to four vertical
|
|
163
|
+
partitions), carrier center dot, deceased slash, **proband filled arrow / consultand
|
|
164
|
+
open arrow**, **consanguineous matings as a double line**, MZ/DZ/unknown-zygosity twins,
|
|
165
|
+
Roman-numeral generations with within-generation "II-3" addresses. A pedigree is a
|
|
166
|
+
clinical record, so structurally invalid input is **refused with coded issues**
|
|
167
|
+
(`PedigreeValidationError`), never silently repaired. The layout is deterministic and
|
|
168
|
+
overlap-proof — including remarriages and multi-spouse hubs.
|
|
169
|
+
|
|
170
|
+
## Phylogenetic tree
|
|
171
|
+
|
|
172
|
+
```ts
|
|
173
|
+
import { phyloSvg } from "compasso/phylo";
|
|
174
|
+
|
|
175
|
+
const { svg } = phyloSvg({
|
|
176
|
+
rootId: 1,
|
|
177
|
+
nodes: [
|
|
178
|
+
{ id: 1, label: "root" },
|
|
179
|
+
{ id: 2, label: "Clade A", support: 98 },
|
|
180
|
+
{ id: 3, label: "Homo sapiens" },
|
|
181
|
+
{ id: 4, label: "Pan troglodytes" },
|
|
182
|
+
],
|
|
183
|
+
edges: [
|
|
184
|
+
{ id: 1, parentId: 1, childId: 2, length: 0.4 },
|
|
185
|
+
{ id: 2, parentId: 2, childId: 3, length: 0.6 },
|
|
186
|
+
{ id: 3, parentId: 2, childId: 4, length: 0.55 },
|
|
187
|
+
],
|
|
188
|
+
}, { mode: "phylogram", showSupport: true });
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
Rectangular cladogram or phylogram. In `phylogram` mode each node's x is its cumulative
|
|
192
|
+
branch length from the root (fit to width); in `cladogram` mode tips right-align with
|
|
193
|
+
optional dotted extensions. Optional bootstrap/posterior `support` values at clades and a
|
|
194
|
+
distance scale bar (phylogram only). The flat `{rootId, nodes, edges}` AST is
|
|
195
|
+
Newick-importable. Branch lengths are never lost — a `null`/zero length is valid (the
|
|
196
|
+
node sits at its parent's depth), and the verbatim length always rides the branch
|
|
197
|
+
`<title>`.
|
|
198
|
+
|
|
142
199
|
## Localization
|
|
143
200
|
|
|
144
201
|
```ts
|
|
@@ -165,10 +222,16 @@ with a negation list. PRs for new locales are welcome.
|
|
|
165
222
|
|
|
166
223
|
The goal is a family of standards-faithful technical diagrams sharing this core
|
|
167
224
|
(text metrics, stroke vocabulary, escaping, legend machinery). Shipped: genogram,
|
|
168
|
-
ecomap, fault tree, fishbone. Next:
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
225
|
+
ecomap, fault tree, fishbone, pedigree, phylogenetic tree. Next: org charts, flow/
|
|
226
|
+
layered diagrams (PRISMA, UML), and symbol-library diagrams (P&ID, single-line, ladder
|
|
227
|
+
logic) — each built from its public standard. AST-first; text DSLs may come later.
|
|
228
|
+
|
|
229
|
+
## Contributing
|
|
230
|
+
|
|
231
|
+
`AGENTS.md` is the contract for changing compasso (the house conventions: pure
|
|
232
|
+
input→SVG, determinism, the honesty rule, the overlap harness, validation doctrine,
|
|
233
|
+
module anatomy). `docs/architecture.md` covers the internal structure and `docs/design/`
|
|
234
|
+
the per-module design rationale.
|
|
172
235
|
|
|
173
236
|
## Provenance & license
|
|
174
237
|
|