@graphty/graph-io 0.3.25 → 0.3.27
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 -414
- package/dist/chunks/children-CL3Cy0ez.js.map +1 -1
- package/dist/chunks/choose-DrXtu_96.js +56 -0
- package/dist/chunks/choose-DrXtu_96.js.map +1 -0
- package/dist/chunks/constants-ikG85dT8.js +231 -0
- package/dist/chunks/constants-ikG85dT8.js.map +1 -0
- package/dist/chunks/{escape-B-tkk_Cl.js → escape-D1HPTUrP.js} +390 -99
- package/dist/chunks/escape-D1HPTUrP.js.map +1 -0
- package/dist/chunks/export-CHd4tQE2.js +4333 -0
- package/dist/chunks/export-CHd4tQE2.js.map +1 -0
- package/dist/chunks/{importer-eUREhBGj.js → exporter-D23CKNqF.js} +4969 -3201
- package/dist/chunks/exporter-D23CKNqF.js.map +1 -0
- package/dist/chunks/{exporter-DIeGJXAZ.js → exporter-DfWTgrti.js} +23 -21
- package/dist/chunks/exporter-DfWTgrti.js.map +1 -0
- package/dist/chunks/exporter-DhtW6FxK.js +3465 -0
- package/dist/chunks/exporter-DhtW6FxK.js.map +1 -0
- package/dist/chunks/{exporter-BGrsWamJ.js → exporter-IHv4nkCm.js} +38 -229
- package/dist/chunks/exporter-IHv4nkCm.js.map +1 -0
- package/dist/chunks/{importer-BWY2FFc5.js → importer-B1wmPQjr.js} +255 -77
- package/dist/chunks/importer-B1wmPQjr.js.map +1 -0
- package/dist/chunks/{importer-D_e7e7LX.js → importer-B2W_58pz.js} +399 -146
- package/dist/chunks/importer-B2W_58pz.js.map +1 -0
- package/dist/chunks/importer-BSALvkui.js +2811 -0
- package/dist/chunks/importer-BSALvkui.js.map +1 -0
- package/dist/chunks/{importer-vi3bSdtw.js → importer-BVRE--Un.js} +510 -77
- package/dist/chunks/importer-BVRE--Un.js.map +1 -0
- package/dist/chunks/{importer-DET1tg6s.js → importer-CIAzt-wo.js} +1689 -312
- package/dist/chunks/importer-CIAzt-wo.js.map +1 -0
- package/dist/chunks/{importer-DIrbbnAf.js → importer-DpEW5zeG.js} +585 -226
- package/dist/chunks/importer-DpEW5zeG.js.map +1 -0
- package/dist/chunks/{importer-zGLo8Dg_.js → importer-z_FL4VMb.js} +488 -161
- package/dist/chunks/importer-z_FL4VMb.js.map +1 -0
- package/dist/chunks/json-elements-BAmNBZok.js +1225 -0
- package/dist/chunks/json-elements-BAmNBZok.js.map +1 -0
- package/dist/chunks/ontology-export-Bab4eUA8.js +357 -0
- package/dist/chunks/ontology-export-Bab4eUA8.js.map +1 -0
- package/dist/chunks/{records-dbRkxwaq.js → records-CdlvL4RO.js} +298 -114
- package/dist/chunks/records-CdlvL4RO.js.map +1 -0
- package/dist/chunks/{text-Dr0Ifpag.js → text-DzXjAiTl.js} +29 -11
- package/dist/chunks/text-DzXjAiTl.js.map +1 -0
- package/dist/chunks/{writer-C7flM-Ih.js → writer-DxjgHwSe.js} +19 -1
- package/dist/chunks/writer-DxjgHwSe.js.map +1 -0
- package/dist/csv.js +952 -262
- package/dist/csv.js.map +1 -1
- package/dist/cx.js +6 -3
- package/dist/cx2.js +2 -2
- package/dist/cys.js +6 -3
- package/dist/dot.js +1 -1
- package/dist/gexf.js +554 -122
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +344 -87
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +1105 -213
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +3 -2
- package/dist/graphml.js.map +1 -1
- package/dist/json.js +3 -2
- package/dist/neo4j.js +565 -158
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +6 -3
- package/dist/pajek.js +1 -1
- package/dist/src/children.d.ts +18 -6
- package/dist/src/children.d.ts.map +1 -1
- package/dist/src/children.js +6 -3
- package/dist/src/children.js.map +1 -1
- package/dist/src/common/attributes.d.ts +29 -11
- package/dist/src/common/attributes.d.ts.map +1 -1
- package/dist/src/common/attributes.js +25 -7
- package/dist/src/common/attributes.js.map +1 -1
- package/dist/src/common/cell-budget.d.ts +9 -2
- package/dist/src/common/cell-budget.d.ts.map +1 -1
- package/dist/src/common/cell-budget.js +11 -3
- package/dist/src/common/cell-budget.js.map +1 -1
- package/dist/src/common/choose.d.ts +19 -0
- package/dist/src/common/choose.d.ts.map +1 -0
- package/dist/src/common/choose.js +72 -0
- package/dist/src/common/choose.js.map +1 -0
- package/dist/src/common/codes.d.ts +456 -66
- package/dist/src/common/codes.d.ts.map +1 -1
- package/dist/src/common/codes.js +458 -66
- package/dist/src/common/codes.js.map +1 -1
- package/dist/src/common/compare.d.ts +81 -0
- package/dist/src/common/compare.d.ts.map +1 -0
- package/dist/src/common/compare.js +394 -0
- package/dist/src/common/compare.js.map +1 -0
- package/dist/src/common/cx-export.d.ts +123 -0
- package/dist/src/common/cx-export.d.ts.map +1 -0
- package/dist/src/common/cx-export.js +334 -0
- package/dist/src/common/cx-export.js.map +1 -0
- package/dist/src/common/declared-types.d.ts +22 -2
- package/dist/src/common/declared-types.d.ts.map +1 -1
- package/dist/src/common/declared-types.js +21 -3
- package/dist/src/common/declared-types.js.map +1 -1
- package/dist/src/common/direction.d.ts +74 -50
- package/dist/src/common/direction.d.ts.map +1 -1
- package/dist/src/common/direction.js +47 -27
- package/dist/src/common/direction.js.map +1 -1
- package/dist/src/common/escape.d.ts +21 -9
- package/dist/src/common/escape.d.ts.map +1 -1
- package/dist/src/common/escape.js +39 -22
- package/dist/src/common/escape.js.map +1 -1
- package/dist/src/common/export.d.ts +144 -32
- package/dist/src/common/export.d.ts.map +1 -1
- package/dist/src/common/export.js +216 -42
- package/dist/src/common/export.js.map +1 -1
- package/dist/src/common/format.d.ts +23 -1
- package/dist/src/common/format.d.ts.map +1 -1
- package/dist/src/common/format.js +26 -1
- package/dist/src/common/format.js.map +1 -1
- package/dist/src/common/ids.d.ts +9 -2
- package/dist/src/common/ids.d.ts.map +1 -1
- package/dist/src/common/ids.js +6 -2
- package/dist/src/common/ids.js.map +1 -1
- package/dist/src/common/input.d.ts +122 -28
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +890 -124
- package/dist/src/common/input.js.map +1 -1
- package/dist/src/common/json-elements.d.ts +144 -20
- package/dist/src/common/json-elements.d.ts.map +1 -1
- package/dist/src/common/json-elements.js +869 -189
- package/dist/src/common/json-elements.js.map +1 -1
- package/dist/src/common/line-format.d.ts +90 -0
- package/dist/src/common/line-format.d.ts.map +1 -0
- package/dist/src/common/line-format.js +185 -0
- package/dist/src/common/line-format.js.map +1 -0
- package/dist/src/common/lists.d.ts +6 -1
- package/dist/src/common/lists.d.ts.map +1 -1
- package/dist/src/common/lists.js +3 -1
- package/dist/src/common/lists.js.map +1 -1
- package/dist/src/common/ontology-export.d.ts +167 -0
- package/dist/src/common/ontology-export.d.ts.map +1 -0
- package/dist/src/common/ontology-export.js +359 -0
- package/dist/src/common/ontology-export.js.map +1 -0
- package/dist/src/common/ontology.d.ts +25 -3
- package/dist/src/common/ontology.d.ts.map +1 -1
- package/dist/src/common/ontology.js +30 -9
- package/dist/src/common/ontology.js.map +1 -1
- package/dist/src/common/options.d.ts +62 -12
- package/dist/src/common/options.d.ts.map +1 -1
- package/dist/src/common/options.js +89 -11
- package/dist/src/common/options.js.map +1 -1
- package/dist/src/common/plural.d.ts +31 -0
- package/dist/src/common/plural.d.ts.map +1 -0
- package/dist/src/common/plural.js +46 -0
- package/dist/src/common/plural.js.map +1 -0
- package/dist/src/common/report.d.ts +72 -14
- package/dist/src/common/report.d.ts.map +1 -1
- package/dist/src/common/report.js +146 -22
- package/dist/src/common/report.js.map +1 -1
- package/dist/src/common/temporal.d.ts +22 -5
- package/dist/src/common/temporal.d.ts.map +1 -1
- package/dist/src/common/temporal.js +13 -2
- package/dist/src/common/temporal.js.map +1 -1
- package/dist/src/common/text.d.ts +39 -23
- package/dist/src/common/text.d.ts.map +1 -1
- package/dist/src/common/text.js +51 -21
- package/dist/src/common/text.js.map +1 -1
- package/dist/src/common/weights.d.ts +37 -4
- package/dist/src/common/weights.d.ts.map +1 -1
- package/dist/src/common/weights.js +61 -2
- package/dist/src/common/weights.js.map +1 -1
- package/dist/src/common/writer.d.ts +19 -3
- package/dist/src/common/writer.d.ts.map +1 -1
- package/dist/src/common/writer.js +30 -2
- package/dist/src/common/writer.js.map +1 -1
- package/dist/src/common/xml.d.ts +125 -9
- package/dist/src/common/xml.d.ts.map +1 -1
- package/dist/src/common/xml.js +402 -85
- package/dist/src/common/xml.js.map +1 -1
- package/dist/src/common/zip.d.ts +44 -4
- package/dist/src/common/zip.d.ts.map +1 -1
- package/dist/src/common/zip.js +134 -5
- package/dist/src/common/zip.js.map +1 -1
- package/dist/src/formats/csv/exporter.d.ts +80 -24
- package/dist/src/formats/csv/exporter.d.ts.map +1 -1
- package/dist/src/formats/csv/exporter.js +146 -33
- package/dist/src/formats/csv/exporter.js.map +1 -1
- package/dist/src/formats/csv/header.d.ts +38 -9
- package/dist/src/formats/csv/header.d.ts.map +1 -1
- package/dist/src/formats/csv/header.js +46 -10
- package/dist/src/formats/csv/header.js.map +1 -1
- package/dist/src/formats/csv/importer.d.ts +187 -37
- package/dist/src/formats/csv/importer.d.ts.map +1 -1
- package/dist/src/formats/csv/importer.js +835 -204
- package/dist/src/formats/csv/importer.js.map +1 -1
- package/dist/src/formats/csv/index.d.ts +100 -19
- package/dist/src/formats/csv/index.d.ts.map +1 -1
- package/dist/src/formats/csv/index.js +94 -21
- package/dist/src/formats/csv/index.js.map +1 -1
- package/dist/src/formats/csv/records.d.ts +95 -10
- package/dist/src/formats/csv/records.d.ts.map +1 -1
- package/dist/src/formats/csv/records.js +333 -122
- package/dist/src/formats/csv/records.js.map +1 -1
- package/dist/src/formats/csv/values.d.ts +1 -0
- package/dist/src/formats/csv/values.d.ts.map +1 -1
- package/dist/src/formats/csv/values.js +1 -0
- package/dist/src/formats/csv/values.js.map +1 -1
- package/dist/src/formats/cx/exporter.d.ts +102 -0
- package/dist/src/formats/cx/exporter.d.ts.map +1 -0
- package/dist/src/formats/cx/exporter.js +1217 -0
- package/dist/src/formats/cx/exporter.js.map +1 -0
- package/dist/src/formats/cx/importer.d.ts +79 -32
- package/dist/src/formats/cx/importer.d.ts.map +1 -1
- package/dist/src/formats/cx/importer.js +682 -287
- package/dist/src/formats/cx/importer.js.map +1 -1
- package/dist/src/formats/cx/index.d.ts +4 -3
- package/dist/src/formats/cx/index.d.ts.map +1 -1
- package/dist/src/formats/cx/index.js +4 -3
- package/dist/src/formats/cx/index.js.map +1 -1
- package/dist/src/formats/cx2/exporter.d.ts +29 -11
- package/dist/src/formats/cx2/exporter.d.ts.map +1 -1
- package/dist/src/formats/cx2/exporter.js +39 -268
- package/dist/src/formats/cx2/exporter.js.map +1 -1
- package/dist/src/formats/cx2/importer.d.ts +78 -28
- package/dist/src/formats/cx2/importer.d.ts.map +1 -1
- package/dist/src/formats/cx2/importer.js +227 -80
- package/dist/src/formats/cx2/importer.js.map +1 -1
- package/dist/src/formats/cx2/index.d.ts +2 -1
- package/dist/src/formats/cx2/index.d.ts.map +1 -1
- package/dist/src/formats/cx2/index.js +2 -1
- package/dist/src/formats/cx2/index.js.map +1 -1
- package/dist/src/formats/cys/constants.d.ts +66 -17
- package/dist/src/formats/cys/constants.d.ts.map +1 -1
- package/dist/src/formats/cys/constants.js +59 -18
- package/dist/src/formats/cys/constants.js.map +1 -1
- package/dist/src/formats/cys/exporter.d.ts +118 -0
- package/dist/src/formats/cys/exporter.d.ts.map +1 -0
- package/dist/src/formats/cys/exporter.js +1072 -0
- package/dist/src/formats/cys/exporter.js.map +1 -0
- package/dist/src/formats/cys/importer.d.ts +22 -8
- package/dist/src/formats/cys/importer.d.ts.map +1 -1
- package/dist/src/formats/cys/importer.js +510 -149
- package/dist/src/formats/cys/importer.js.map +1 -1
- package/dist/src/formats/cys/index.d.ts +4 -2
- package/dist/src/formats/cys/index.d.ts.map +1 -1
- package/dist/src/formats/cys/index.js +4 -2
- package/dist/src/formats/cys/index.js.map +1 -1
- package/dist/src/formats/cys/session.d.ts +46 -7
- package/dist/src/formats/cys/session.d.ts.map +1 -1
- package/dist/src/formats/cys/session.js +101 -27
- package/dist/src/formats/cys/session.js.map +1 -1
- package/dist/src/formats/cys/tables.d.ts +9 -2
- package/dist/src/formats/cys/tables.d.ts.map +1 -1
- package/dist/src/formats/cys/tables.js +29 -7
- package/dist/src/formats/cys/tables.js.map +1 -1
- package/dist/src/formats/dot/exporter.d.ts +42 -14
- package/dist/src/formats/dot/exporter.d.ts.map +1 -1
- package/dist/src/formats/dot/exporter.js +56 -29
- package/dist/src/formats/dot/exporter.js.map +1 -1
- package/dist/src/formats/dot/importer.d.ts +91 -29
- package/dist/src/formats/dot/importer.d.ts.map +1 -1
- package/dist/src/formats/dot/importer.js +190 -39
- package/dist/src/formats/dot/importer.js.map +1 -1
- package/dist/src/formats/dot/index.d.ts +2 -1
- package/dist/src/formats/dot/index.d.ts.map +1 -1
- package/dist/src/formats/dot/index.js +2 -1
- package/dist/src/formats/dot/index.js.map +1 -1
- package/dist/src/formats/dot/names.d.ts +44 -11
- package/dist/src/formats/dot/names.d.ts.map +1 -1
- package/dist/src/formats/dot/names.js +44 -11
- package/dist/src/formats/dot/names.js.map +1 -1
- package/dist/src/formats/dot/tokenizer.d.ts +9 -2
- package/dist/src/formats/dot/tokenizer.d.ts.map +1 -1
- package/dist/src/formats/dot/tokenizer.js +20 -5
- package/dist/src/formats/dot/tokenizer.js.map +1 -1
- package/dist/src/formats/gexf/exporter.d.ts +46 -15
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
- package/dist/src/formats/gexf/exporter.js +45 -15
- package/dist/src/formats/gexf/exporter.js.map +1 -1
- package/dist/src/formats/gexf/importer.d.ts +87 -23
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +471 -90
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gexf/index.d.ts +84 -21
- package/dist/src/formats/gexf/index.d.ts.map +1 -1
- package/dist/src/formats/gexf/index.js +80 -23
- package/dist/src/formats/gexf/index.js.map +1 -1
- package/dist/src/formats/gexf/schema.d.ts +67 -15
- package/dist/src/formats/gexf/schema.d.ts.map +1 -1
- package/dist/src/formats/gexf/schema.js +59 -13
- package/dist/src/formats/gexf/schema.js.map +1 -1
- package/dist/src/formats/gml/exporter.d.ts +69 -21
- package/dist/src/formats/gml/exporter.d.ts.map +1 -1
- package/dist/src/formats/gml/exporter.js +74 -29
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/gml/importer.d.ts +116 -25
- package/dist/src/formats/gml/importer.d.ts.map +1 -1
- package/dist/src/formats/gml/importer.js +290 -61
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/index.d.ts +87 -24
- package/dist/src/formats/gml/index.d.ts.map +1 -1
- package/dist/src/formats/gml/index.js +79 -26
- package/dist/src/formats/gml/index.js.map +1 -1
- package/dist/src/formats/gml/syntax.d.ts +67 -18
- package/dist/src/formats/gml/syntax.d.ts.map +1 -1
- package/dist/src/formats/gml/syntax.js +110 -28
- package/dist/src/formats/gml/syntax.js.map +1 -1
- package/dist/src/formats/graphml/constants.d.ts +174 -44
- package/dist/src/formats/graphml/constants.d.ts.map +1 -1
- package/dist/src/formats/graphml/constants.js +165 -44
- package/dist/src/formats/graphml/constants.js.map +1 -1
- package/dist/src/formats/graphml/exporter.d.ts +17 -9
- package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
- package/dist/src/formats/graphml/exporter.js +33 -12
- package/dist/src/formats/graphml/exporter.js.map +1 -1
- package/dist/src/formats/graphml/importer.d.ts +19 -7
- package/dist/src/formats/graphml/importer.d.ts.map +1 -1
- package/dist/src/formats/graphml/importer.js +466 -39
- package/dist/src/formats/graphml/importer.js.map +1 -1
- package/dist/src/formats/graphml/index.d.ts +2 -1
- package/dist/src/formats/graphml/index.d.ts.map +1 -1
- package/dist/src/formats/graphml/index.js +2 -1
- package/dist/src/formats/graphml/index.js.map +1 -1
- package/dist/src/formats/graphml/tree.d.ts +6 -2
- package/dist/src/formats/graphml/tree.d.ts.map +1 -1
- package/dist/src/formats/graphml/tree.js +6 -2
- package/dist/src/formats/graphml/tree.js.map +1 -1
- package/dist/src/formats/graphml/yfiles.d.ts +8 -3
- package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
- package/dist/src/formats/graphml/yfiles.js +36 -15
- package/dist/src/formats/graphml/yfiles.js.map +1 -1
- package/dist/src/formats/json/dialect.d.ts +88 -24
- package/dist/src/formats/json/dialect.d.ts.map +1 -1
- package/dist/src/formats/json/dialect.js +109 -19
- package/dist/src/formats/json/dialect.js.map +1 -1
- package/dist/src/formats/json/exporter.d.ts +134 -22
- package/dist/src/formats/json/exporter.d.ts.map +1 -1
- package/dist/src/formats/json/exporter.js +135 -54
- package/dist/src/formats/json/exporter.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts +173 -52
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +899 -220
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/index.d.ts +3 -2
- package/dist/src/formats/json/index.d.ts.map +1 -1
- package/dist/src/formats/json/index.js +3 -2
- package/dist/src/formats/json/index.js.map +1 -1
- package/dist/src/formats/json/obographs-export.d.ts +68 -0
- package/dist/src/formats/json/obographs-export.d.ts.map +1 -0
- package/dist/src/formats/json/obographs-export.js +941 -0
- package/dist/src/formats/json/obographs-export.js.map +1 -0
- package/dist/src/formats/json/obographs.d.ts +26 -0
- package/dist/src/formats/json/obographs.d.ts.map +1 -1
- package/dist/src/formats/json/obographs.js +297 -80
- package/dist/src/formats/json/obographs.js.map +1 -1
- package/dist/src/formats/neo4j/exporter.d.ts +109 -21
- package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
- package/dist/src/formats/neo4j/exporter.js +239 -86
- package/dist/src/formats/neo4j/exporter.js.map +1 -1
- package/dist/src/formats/neo4j/header.d.ts +17 -4
- package/dist/src/formats/neo4j/header.d.ts.map +1 -1
- package/dist/src/formats/neo4j/header.js +36 -4
- package/dist/src/formats/neo4j/header.js.map +1 -1
- package/dist/src/formats/neo4j/importer.d.ts +107 -27
- package/dist/src/formats/neo4j/importer.d.ts.map +1 -1
- package/dist/src/formats/neo4j/importer.js +415 -63
- package/dist/src/formats/neo4j/importer.js.map +1 -1
- package/dist/src/formats/neo4j/index.d.ts +73 -23
- package/dist/src/formats/neo4j/index.d.ts.map +1 -1
- package/dist/src/formats/neo4j/index.js +65 -25
- package/dist/src/formats/neo4j/index.js.map +1 -1
- package/dist/src/formats/obo/exporter.d.ts +150 -0
- package/dist/src/formats/obo/exporter.d.ts.map +1 -0
- package/dist/src/formats/obo/exporter.js +1736 -0
- package/dist/src/formats/obo/exporter.js.map +1 -0
- package/dist/src/formats/obo/importer.d.ts +95 -19
- package/dist/src/formats/obo/importer.d.ts.map +1 -1
- package/dist/src/formats/obo/importer.js +475 -104
- package/dist/src/formats/obo/importer.js.map +1 -1
- package/dist/src/formats/obo/index.d.ts +6 -3
- package/dist/src/formats/obo/index.d.ts.map +1 -1
- package/dist/src/formats/obo/index.js +6 -3
- package/dist/src/formats/obo/index.js.map +1 -1
- package/dist/src/formats/obo/syntax.d.ts +108 -4
- package/dist/src/formats/obo/syntax.d.ts.map +1 -1
- package/dist/src/formats/obo/syntax.js +211 -34
- package/dist/src/formats/obo/syntax.js.map +1 -1
- package/dist/src/formats/pajek/exporter.d.ts +54 -16
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +67 -35
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.d.ts +84 -22
- package/dist/src/formats/pajek/importer.d.ts.map +1 -1
- package/dist/src/formats/pajek/importer.js +303 -83
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/index.d.ts +2 -1
- package/dist/src/formats/pajek/index.d.ts.map +1 -1
- package/dist/src/formats/pajek/index.js +2 -1
- package/dist/src/formats/pajek/index.js.map +1 -1
- package/dist/src/formats/pajek/syntax.d.ts +77 -14
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +186 -54
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/columns.d.ts +1 -0
- package/dist/src/formats/xgmml/columns.d.ts.map +1 -1
- package/dist/src/formats/xgmml/columns.js +4 -0
- package/dist/src/formats/xgmml/columns.js.map +1 -1
- package/dist/src/formats/xgmml/constants.d.ts +186 -56
- package/dist/src/formats/xgmml/constants.d.ts.map +1 -1
- package/dist/src/formats/xgmml/constants.js +181 -57
- package/dist/src/formats/xgmml/constants.js.map +1 -1
- package/dist/src/formats/xgmml/document.d.ts +65 -11
- package/dist/src/formats/xgmml/document.d.ts.map +1 -1
- package/dist/src/formats/xgmml/document.js +157 -28
- package/dist/src/formats/xgmml/document.js.map +1 -1
- package/dist/src/formats/xgmml/emit.d.ts +61 -3
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
- package/dist/src/formats/xgmml/emit.js +129 -26
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/exporter.d.ts +13 -6
- package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
- package/dist/src/formats/xgmml/exporter.js +21 -22
- package/dist/src/formats/xgmml/exporter.js.map +1 -1
- package/dist/src/formats/xgmml/importer.d.ts +33 -12
- package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
- package/dist/src/formats/xgmml/importer.js +35 -72
- package/dist/src/formats/xgmml/importer.js.map +1 -1
- package/dist/src/formats/xgmml/index.d.ts +1 -0
- package/dist/src/formats/xgmml/index.d.ts.map +1 -1
- package/dist/src/formats/xgmml/index.js +1 -0
- package/dist/src/formats/xgmml/index.js.map +1 -1
- package/dist/src/formats/xgmml/values.d.ts +8 -1
- package/dist/src/formats/xgmml/values.d.ts.map +1 -1
- package/dist/src/formats/xgmml/values.js +8 -3
- package/dist/src/formats/xgmml/values.js.map +1 -1
- package/dist/src/index.d.ts +23 -18
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +28 -16
- package/dist/src/index.js.map +1 -1
- package/dist/src/registry.d.ts +478 -92
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +807 -88
- package/dist/src/registry.js.map +1 -1
- package/dist/src/sniff.d.ts +61 -19
- package/dist/src/sniff.d.ts.map +1 -1
- package/dist/src/sniff.js +121 -29
- package/dist/src/sniff.js.map +1 -1
- package/dist/src/types.d.ts +362 -112
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js +28 -7
- package/dist/src/types.js.map +1 -1
- package/dist/xgmml.js +2 -2
- package/docs/samples/README.md +25 -0
- package/docs/samples/got-edges.csv +353 -0
- package/docs/samples/got-network.graphml +1384 -0
- package/docs/samples/got-nodes.csv +108 -0
- package/docs/samples/got.cx +930 -0
- package/docs/samples/got.cx2 +465 -0
- package/docs/samples/got.gexf +471 -0
- package/docs/samples/got.gml +2650 -0
- package/docs/samples/got.json +2546 -0
- package/docs/samples/got.net +461 -0
- package/docs/samples/movies-nodes.csv +9 -0
- package/docs/samples/movies-rels.csv +8 -0
- package/docs/samples/networks.cys +0 -0
- package/docs/samples/proteins.xgmml +9 -0
- package/docs/samples/teams.gv +24 -0
- package/docs/samples/vehicles.obo +25 -0
- package/package.json +9 -4
- package/src/children.ts +18 -6
- package/src/common/attributes.ts +29 -11
- package/src/common/cell-budget.ts +11 -3
- package/src/common/choose.ts +89 -0
- package/src/common/codes.ts +490 -66
- package/src/common/compare.ts +472 -0
- package/src/common/cx-export.ts +432 -0
- package/src/common/declared-types.ts +40 -6
- package/src/common/direction.ts +78 -51
- package/src/common/escape.ts +39 -22
- package/src/common/export.ts +284 -47
- package/src/common/format.ts +30 -1
- package/src/common/ids.ts +14 -3
- package/src/common/input.ts +1057 -134
- package/src/common/json-elements.ts +1035 -199
- package/src/common/line-format.ts +249 -0
- package/src/common/lists.ts +7 -2
- package/src/common/ontology-export.ts +461 -0
- package/src/common/ontology.ts +31 -9
- package/src/common/options.ts +110 -15
- package/src/common/plural.ts +49 -0
- package/src/common/report.ts +168 -25
- package/src/common/temporal.ts +22 -5
- package/src/common/text.ts +62 -23
- package/src/common/weights.ts +74 -4
- package/src/common/writer.ts +37 -3
- package/src/common/xml.ts +479 -90
- package/src/common/zip.ts +169 -7
- package/src/formats/csv/exporter.ts +202 -47
- package/src/formats/csv/header.ts +50 -11
- package/src/formats/csv/importer.ts +1133 -245
- package/src/formats/csv/index.ts +106 -19
- package/src/formats/csv/records.ts +396 -122
- package/src/formats/csv/values.ts +1 -0
- package/src/formats/cx/exporter.ts +1483 -0
- package/src/formats/cx/importer.ts +890 -302
- package/src/formats/cx/index.ts +4 -3
- package/src/formats/cx2/exporter.ts +62 -339
- package/src/formats/cx2/importer.ts +318 -87
- package/src/formats/cx2/index.ts +2 -1
- package/src/formats/cys/constants.ts +62 -17
- package/src/formats/cys/exporter.ts +1368 -0
- package/src/formats/cys/importer.ts +659 -157
- package/src/formats/cys/index.ts +4 -2
- package/src/formats/cys/session.ts +142 -34
- package/src/formats/cys/tables.ts +47 -9
- package/src/formats/dot/exporter.ts +83 -37
- package/src/formats/dot/importer.ts +248 -54
- package/src/formats/dot/index.ts +2 -1
- package/src/formats/dot/names.ts +44 -11
- package/src/formats/dot/tokenizer.ts +25 -6
- package/src/formats/gexf/exporter.ts +57 -18
- package/src/formats/gexf/importer.ts +636 -105
- package/src/formats/gexf/index.ts +90 -21
- package/src/formats/gexf/schema.ts +67 -15
- package/src/formats/gml/exporter.ts +90 -36
- package/src/formats/gml/importer.ts +388 -67
- package/src/formats/gml/index.ts +85 -24
- package/src/formats/gml/syntax.ts +113 -28
- package/src/formats/graphml/constants.ts +178 -44
- package/src/formats/graphml/exporter.ts +52 -18
- package/src/formats/graphml/importer.ts +640 -60
- package/src/formats/graphml/index.ts +2 -1
- package/src/formats/graphml/tree.ts +6 -2
- package/src/formats/graphml/yfiles.ts +37 -15
- package/src/formats/json/dialect.ts +128 -29
- package/src/formats/json/exporter.ts +205 -68
- package/src/formats/json/importer.ts +1163 -253
- package/src/formats/json/index.ts +3 -1
- package/src/formats/json/obographs-export.ts +1197 -0
- package/src/formats/json/obographs.ts +353 -92
- package/src/formats/neo4j/exporter.ts +321 -102
- package/src/formats/neo4j/header.ts +44 -6
- package/src/formats/neo4j/importer.ts +512 -73
- package/src/formats/neo4j/index.ts +75 -23
- package/src/formats/obo/exporter.ts +2210 -0
- package/src/formats/obo/importer.ts +622 -109
- package/src/formats/obo/index.ts +6 -3
- package/src/formats/obo/syntax.ts +232 -37
- package/src/formats/pajek/exporter.ts +90 -42
- package/src/formats/pajek/importer.ts +407 -93
- package/src/formats/pajek/index.ts +2 -1
- package/src/formats/pajek/syntax.ts +216 -55
- package/src/formats/xgmml/columns.ts +10 -0
- package/src/formats/xgmml/constants.ts +183 -56
- package/src/formats/xgmml/document.ts +212 -34
- package/src/formats/xgmml/emit.ts +175 -34
- package/src/formats/xgmml/exporter.ts +36 -28
- package/src/formats/xgmml/importer.ts +64 -86
- package/src/formats/xgmml/index.ts +1 -0
- package/src/formats/xgmml/values.ts +12 -4
- package/src/index.ts +81 -11
- package/src/registry.ts +1121 -135
- package/src/sniff.ts +163 -32
- package/src/types.ts +385 -114
- package/dist/chunks/escape-B-tkk_Cl.js.map +0 -1
- package/dist/chunks/export-Bh60Dv-n.js +0 -582
- package/dist/chunks/export-Bh60Dv-n.js.map +0 -1
- package/dist/chunks/exporter-BGrsWamJ.js.map +0 -1
- package/dist/chunks/exporter-DIeGJXAZ.js.map +0 -1
- package/dist/chunks/importer-BWY2FFc5.js.map +0 -1
- package/dist/chunks/importer-DD-xv9_Y.js +0 -1471
- package/dist/chunks/importer-DD-xv9_Y.js.map +0 -1
- package/dist/chunks/importer-DET1tg6s.js.map +0 -1
- package/dist/chunks/importer-DEcKhsmQ.js +0 -1614
- package/dist/chunks/importer-DEcKhsmQ.js.map +0 -1
- package/dist/chunks/importer-DIrbbnAf.js.map +0 -1
- package/dist/chunks/importer-D_e7e7LX.js.map +0 -1
- package/dist/chunks/importer-eUREhBGj.js.map +0 -1
- package/dist/chunks/importer-vi3bSdtw.js.map +0 -1
- package/dist/chunks/importer-zGLo8Dg_.js.map +0 -1
- package/dist/chunks/json-elements-DDS8N2Dd.js +0 -779
- package/dist/chunks/json-elements-DDS8N2Dd.js.map +0 -1
- package/dist/chunks/ontology-BnrJ4I98.js +0 -113
- package/dist/chunks/ontology-BnrJ4I98.js.map +0 -1
- package/dist/chunks/records-dbRkxwaq.js.map +0 -1
- package/dist/chunks/report-B1z4WT9e.js +0 -2372
- package/dist/chunks/report-B1z4WT9e.js.map +0 -1
- package/dist/chunks/text-Dr0Ifpag.js.map +0 -1
- package/dist/chunks/weights-Dzba96G3.js +0 -176
- package/dist/chunks/weights-Dzba96G3.js.map +0 -1
- package/dist/chunks/writer-C7flM-Ih.js.map +0 -1
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* The node columns of the OBO vocabulary, keyed by column name (design section 4.2). The names are
|
|
9
9
|
* the OBO tag names, so a Gene Ontology user finds `namespace`, `def` and `is_obsolete` under the
|
|
10
10
|
* names the GO documentation uses.
|
|
11
|
+
* @category Plugin helpers
|
|
11
12
|
*/
|
|
12
13
|
export const OBO_NODE_COLUMNS = Object.freeze({
|
|
13
14
|
type: { dtype: "dict" },
|
|
@@ -65,13 +66,17 @@ const OBO_EDGE_COLUMNS = Object.freeze({
|
|
|
65
66
|
qualifiers: { dtype: "json" },
|
|
66
67
|
meta: { dtype: "json" },
|
|
67
68
|
});
|
|
68
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* The node column that marks a node made for an undeclared reference (design section 4.2).
|
|
71
|
+
* @category Plugin helpers
|
|
72
|
+
*/
|
|
69
73
|
export const PLACEHOLDER_COLUMN = "graphty.placeholder";
|
|
70
74
|
/**
|
|
71
75
|
* The declaration of an OBO vocabulary column.
|
|
72
76
|
* @param domain - node or edge
|
|
73
77
|
* @param name - the column name (a key of OBO_NODE_COLUMNS / OBO_EDGE_COLUMNS, or the placeholder column)
|
|
74
78
|
* @returns the declaration, nullable, with origin `{ format: "obo", id: name }`
|
|
79
|
+
* @category Plugin helpers
|
|
75
80
|
*/
|
|
76
81
|
export function oboColumnDecl(domain, name) {
|
|
77
82
|
if (name === PLACEHOLDER_COLUMN) {
|
|
@@ -87,24 +92,35 @@ export function oboColumnDecl(domain, name) {
|
|
|
87
92
|
}
|
|
88
93
|
return decl;
|
|
89
94
|
}
|
|
90
|
-
/**
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
95
|
+
/**
|
|
96
|
+
* The OBO PURL base every OBO Foundry IRI starts with.
|
|
97
|
+
* @category Plugin helpers
|
|
98
|
+
*/
|
|
99
|
+
export const OBO_PURL = "http://purl.obolibrary.org/obo/"; // NOSONAR(S5332): an identifier the OBO standard fixes, never fetched
|
|
100
|
+
/** The same base under https, which newer OBO Graphs writers use. */
|
|
101
|
+
const OBO_PURL_HTTPS = "https://purl.obolibrary.org/obo/";
|
|
102
|
+
/**
|
|
103
|
+
* The oboInOwl namespace of the OBO-to-OWL mapping's annotation properties.
|
|
104
|
+
* @category Plugin helpers
|
|
105
|
+
*/
|
|
106
|
+
export const OBO_IN_OWL = "http://www.geneontology.org/formats/oboInOwl#"; // NOSONAR(S5332): an identifier the OBO standard fixes, never fetched
|
|
94
107
|
/**
|
|
95
108
|
* An IRI as the identifier the `.obo` file writes (the OBO 1.4 mapping, section 5.9, read
|
|
96
109
|
* backwards): `http://purl.obolibrary.org/obo/GO_0008150` is `GO:0008150` (the prefix is the text
|
|
97
110
|
* before the first underscore), and `http://purl.obolibrary.org/obo/go#regulates` (how the OWL
|
|
98
|
-
* translation writes an unprefixed OBO id: subsets, relations, synonym types) is `regulates
|
|
111
|
+
* translation writes an unprefixed OBO id: subsets, relations, synonym types) is `regulates`; the
|
|
112
|
+
* same under `https://purl.obolibrary.org/obo/`.
|
|
99
113
|
* Every other IRI, and an OBO PURL that fits neither form (`.../obo/T/Female`), is kept.
|
|
100
114
|
* @param iri - the IRI
|
|
101
115
|
* @returns the CURIE or local id, or the IRI unchanged
|
|
116
|
+
* @category Plugin helpers
|
|
102
117
|
*/
|
|
103
118
|
export function compactOboIri(iri) {
|
|
104
|
-
|
|
119
|
+
const base = [OBO_PURL, OBO_PURL_HTTPS].find((b) => iri.startsWith(b));
|
|
120
|
+
if (base === undefined) {
|
|
105
121
|
return iri;
|
|
106
122
|
}
|
|
107
|
-
const rest = iri.slice(
|
|
123
|
+
const rest = iri.slice(base.length);
|
|
108
124
|
const hash = rest.indexOf("#");
|
|
109
125
|
if (hash > 0) {
|
|
110
126
|
const local = rest.slice(hash + 1);
|
|
@@ -116,13 +132,17 @@ export function compactOboIri(iri) {
|
|
|
116
132
|
}
|
|
117
133
|
return `${rest.slice(0, underscore)}:${rest.slice(underscore + 1)}`;
|
|
118
134
|
}
|
|
119
|
-
/**
|
|
135
|
+
/**
|
|
136
|
+
* The OBO synonym scopes.
|
|
137
|
+
* @category Plugin helpers
|
|
138
|
+
*/
|
|
120
139
|
export const SYNONYM_SCOPES = new Set(["EXACT", "BROAD", "NARROW", "RELATED"]);
|
|
121
140
|
/**
|
|
122
141
|
* The OBO synonym scope of an OBO Graphs synonym predicate (`hasExactSynonym`, with or without the
|
|
123
142
|
* oboInOwl namespace).
|
|
124
143
|
* @param pred - the predicate
|
|
125
144
|
* @returns the scope, or null for a predicate that is not one of the four
|
|
145
|
+
* @category Plugin helpers
|
|
126
146
|
*/
|
|
127
147
|
export function synonymScopeOf(pred) {
|
|
128
148
|
const local = pred.startsWith(OBO_IN_OWL) ? pred.slice(OBO_IN_OWL.length) : pred;
|
|
@@ -134,6 +154,7 @@ export function synonymScopeOf(pred) {
|
|
|
134
154
|
* the tags that are annotations), so the `.json` of an ontology fills the same columns as its
|
|
135
155
|
* `.obo`. `shorthand` is the relation's short name; every predicate not listed is a
|
|
136
156
|
* `property_value`.
|
|
157
|
+
* @category Plugin helpers
|
|
137
158
|
*/
|
|
138
159
|
export const OBOGRAPHS_PREDICATE_TAGS = new Map([
|
|
139
160
|
[`${OBO_IN_OWL}hasOBONamespace`, "namespace"],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ontology.js","sourceRoot":"","sources":["../../../src/common/ontology.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH
|
|
1
|
+
{"version":3,"file":"ontology.js","sourceRoot":"","sources":["../../../src/common/ontology.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAeH;;;;;GAKG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAA4C,MAAM,CAAC,MAAM,CAAC;IACnF,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IACvB,IAAI,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,EAAE;IACxC,SAAS,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IAC5B,GAAG,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;IACxB,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IAC9B,OAAO,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE;IAC5B,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IAC1B,IAAI,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IACvB,mBAAmB,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IACtC,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IACzB,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IACzB,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IAC9B,QAAQ,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IAC3B,WAAW,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IAC9B,YAAY,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IAC/B,OAAO,EAAE,EAAE,KAAK,EAAE,MAAM,EAAE;IAC1B,UAAU,EAAE,EAAE,K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AAC,GAAG,UAAU,WAAW,EAAE,WAAW,CAAC;CAC1C,CAAC,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Option
|
|
2
|
+
* Option normalization for importers and exporters (design sections 8.4 and 8.5): every common
|
|
3
3
|
* option resolved to its documented default, enum values checked (E_UNSUPPORTED, the core's
|
|
4
4
|
* convention for an option outside its set), and the per-format defaults (`ids`, `defaultDirected`,
|
|
5
5
|
* `weightFrom`, `addMissingNodes`) supplied by the importer that calls resolveImportOptions().
|
|
@@ -8,7 +8,10 @@ import { type DuplicatePolicy, type GraphSink, type IdCoercion } from "@graphty/
|
|
|
8
8
|
import { type CommonExportOptions, type CommonImportOptions, type GraphChoiceOptions } from "../types.js";
|
|
9
9
|
import { SINK_OPTION_CODE } from "./codes.js";
|
|
10
10
|
import { type ImportReportBuilder } from "./report.js";
|
|
11
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The defaults an importer supplies for the options whose default is per format.
|
|
13
|
+
* @category Plugin helpers
|
|
14
|
+
*/
|
|
12
15
|
export interface ImportFormatDefaults {
|
|
13
16
|
/** "canonical" for text-cell formats, "keep" for JSON. */
|
|
14
17
|
readonly ids: IdCoercion;
|
|
@@ -20,9 +23,9 @@ export interface ImportFormatDefaults {
|
|
|
20
23
|
readonly addMissingNodes?: boolean | undefined;
|
|
21
24
|
}
|
|
22
25
|
/**
|
|
23
|
-
* CommonImportOptions with every field present
|
|
24
|
-
* Consumed by the per-format importers and exporters under src/formats.
|
|
26
|
+
* CommonImportOptions with every field present.
|
|
25
27
|
* @public
|
|
28
|
+
* @category Plugin helpers
|
|
26
29
|
*/
|
|
27
30
|
export interface ResolvedImportOptions {
|
|
28
31
|
/** The id coercion rule. */
|
|
@@ -58,41 +61,57 @@ export interface ResolvedImportOptions {
|
|
|
58
61
|
/** The caller's byte encoding (canonical name), or null to detect it. */
|
|
59
62
|
readonly encoding: string | null;
|
|
60
63
|
}
|
|
61
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* CommonExportOptions with every field present.
|
|
66
|
+
* @category Plugin helpers
|
|
67
|
+
*/
|
|
62
68
|
export interface ResolvedExportOptions {
|
|
63
69
|
/** "error" never renames a node; "mangle" rewrites and keeps the original. */
|
|
64
70
|
readonly sanitizeIds: "error" | "mangle";
|
|
65
71
|
/** What a format without mixed-direction support does with a mixed snapshot. */
|
|
66
72
|
readonly onMixedDirection: "error" | "directed" | "undirected";
|
|
67
73
|
}
|
|
68
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* The default error limit: errors tolerated before an import aborts.
|
|
76
|
+
* @category Reports and errors
|
|
77
|
+
*/
|
|
69
78
|
export declare const DEFAULT_ERROR_LIMIT = 100;
|
|
70
79
|
export { SINK_OPTION_CODE };
|
|
71
80
|
/**
|
|
72
|
-
* Report every builder-policy option the caller explicitly requested that the sink does not use
|
|
73
|
-
*
|
|
81
|
+
* Report every builder-policy option the caller explicitly requested that the sink does not use,
|
|
82
|
+
* one `W_SINK_OPTION` warning per option with the option name as
|
|
74
83
|
* the element. Options left undefined are never reported: they are defaults, not requests. On the
|
|
75
84
|
* registry's builder, which is seeded from the same options, nothing is ever reported.
|
|
76
85
|
* @param sink - the sink the importer pushes into
|
|
77
86
|
* @param options - the caller's raw options, possibly undefined
|
|
78
87
|
* @param report - the report to record into
|
|
79
88
|
* @param enforcesMissingNodes - true when the importer applies `addMissingNodes: false` itself (it
|
|
80
|
-
* refuses unknown endpoints before the sink sees them), so that request is
|
|
89
|
+
* refuses unknown endpoints before the sink sees them), so that request is honored on any sink and
|
|
81
90
|
* only `addMissingNodes: true` against a refusing sink is reported
|
|
82
91
|
* @returns the number of warnings recorded
|
|
92
|
+
* @category Writing a format
|
|
83
93
|
*/
|
|
84
94
|
export declare function reportSinkOptions(sink: GraphSink, options: CommonImportOptions | undefined, report: ImportReportBuilder, enforcesMissingNodes?: boolean): number;
|
|
85
95
|
/**
|
|
86
96
|
* Report every common option the caller set to a non-default value that the format has no use
|
|
87
|
-
* for
|
|
97
|
+
* for: one
|
|
88
98
|
* `W_OPTION_IGNORED` warning (category `unsupported`) per option, the option name as the element.
|
|
89
99
|
* The builder-policy options are reportSinkOptions()'s and are skipped here.
|
|
90
100
|
* @param options - the caller's raw options, possibly undefined
|
|
91
101
|
* @param report - the report to record into
|
|
92
102
|
* @param used - the common option names the importer reads
|
|
93
103
|
* @returns the number of warnings recorded
|
|
104
|
+
* @category Writing a format
|
|
94
105
|
*/
|
|
95
106
|
export declare function reportUnusedOptions(options: CommonImportOptions | undefined, report: ImportReportBuilder, used: ReadonlySet<keyof CommonImportOptions>): number;
|
|
107
|
+
/**
|
|
108
|
+
* Whether the caller chose a graph with `graphIndex` or `graphName`. An importer warns
|
|
109
|
+
* W_MULTIPLE_GRAPHS about the graphs it skipped only when it read the first by default.
|
|
110
|
+
* @param options - the caller's graphIndex / graphName
|
|
111
|
+
* @returns true when either option is set
|
|
112
|
+
* @category Writing a format
|
|
113
|
+
*/
|
|
114
|
+
export declare function graphChosen(options: GraphChoiceOptions | undefined): boolean;
|
|
96
115
|
/**
|
|
97
116
|
* The graph an importer reads from an input that holds several: the one `graphIndex` or
|
|
98
117
|
* `graphName` names, else the first. A choice that names no graph is E_GRAPH_NOT_FOUND, a name two
|
|
@@ -102,26 +121,57 @@ export declare function reportUnusedOptions(options: CommonImportOptions | undef
|
|
|
102
121
|
* @param options - the caller's graphIndex / graphName
|
|
103
122
|
* @param report - the report a failure is recorded in
|
|
104
123
|
* @returns the index of the graph to read; E_UNSUPPORTED for an option of the wrong type, or both
|
|
124
|
+
* @category Writing a format
|
|
105
125
|
*/
|
|
106
126
|
export declare function chooseGraph(names: readonly (string | null)[], options: GraphChoiceOptions | undefined, report: ImportReportBuilder): number;
|
|
107
127
|
/**
|
|
108
|
-
* Apply the
|
|
128
|
+
* Apply the documented defaults to an importer's common options and check every enum
|
|
109
129
|
* value. Format-specific options in the same object are ignored here.
|
|
110
130
|
* @param options - the caller's options, possibly undefined
|
|
111
131
|
* @param defaults - the importer's per-format defaults
|
|
112
132
|
* @returns the resolved options; E_UNSUPPORTED for a value outside its set
|
|
133
|
+
* @category Writing a format
|
|
113
134
|
*/
|
|
114
135
|
export declare function resolveImportOptions(options: CommonImportOptions | undefined, defaults: ImportFormatDefaults): ResolvedImportOptions;
|
|
115
136
|
/**
|
|
116
|
-
* Apply the
|
|
137
|
+
* Apply the documented defaults to an exporter's common options and check the enum values.
|
|
117
138
|
* @param options - the caller's options, possibly undefined
|
|
118
139
|
* @returns the resolved options; E_UNSUPPORTED for a value outside its set
|
|
140
|
+
* @category Writing a format
|
|
119
141
|
*/
|
|
120
142
|
export declare function resolveExportOptions(options: CommonExportOptions | undefined): ResolvedExportOptions;
|
|
143
|
+
/**
|
|
144
|
+
* The options to pass to another importer that you hand text you already decoded with readText():
|
|
145
|
+
* the caller's options without `encoding` and `onProgress`, which that text no longer needs. Without
|
|
146
|
+
* this, the other importer would warn that `encoding` has no effect on text, and report progress a
|
|
147
|
+
* second time.
|
|
148
|
+
* @example
|
|
149
|
+
* ```ts
|
|
150
|
+
* const text = await readText(input, report, opts);
|
|
151
|
+
* report.include(await csvImporter.import(text, sink, forDecodedText(options)));
|
|
152
|
+
* ```
|
|
153
|
+
* @param options - the caller's import options
|
|
154
|
+
* @returns a copy without `encoding` and `onProgress`
|
|
155
|
+
* @category Writing a format
|
|
156
|
+
*/
|
|
157
|
+
export declare function forDecodedText<O extends CommonImportOptions>(options: O | undefined): O;
|
|
158
|
+
/**
|
|
159
|
+
* The dialect names of the built-in formats with a `dialect` save option. One options object shared between formats
|
|
160
|
+
* can hold one format's dialect, and the other formats ignore it, as they ignore any option they do not have.
|
|
161
|
+
*/
|
|
162
|
+
export declare const FORMAT_DIALECTS: Readonly<Record<string, readonly string[]>>;
|
|
163
|
+
/**
|
|
164
|
+
* Whether a `dialect` value names another format's dialect, which this format ignores rather than refuses.
|
|
165
|
+
* @param format - this format
|
|
166
|
+
* @param value - the caller's `dialect` option
|
|
167
|
+
* @returns true for another built-in format's dialect name
|
|
168
|
+
*/
|
|
169
|
+
export declare function otherFormatDialect(format: string, value: unknown): boolean;
|
|
121
170
|
/**
|
|
122
171
|
* A short description of an option value for an error message.
|
|
123
172
|
* @param value - the value
|
|
124
173
|
* @returns the JSON text of a primitive, or the type name otherwise
|
|
174
|
+
* @category Plugin helpers
|
|
125
175
|
*/
|
|
126
176
|
export declare function describe(value: unknown): string;
|
|
127
177
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/common/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAoB,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEhH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,EAKH,gBAAgB,EACnB,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/common/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,KAAK,eAAe,EAAoB,KAAK,SAAS,EAAE,KAAK,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAEhH,OAAO,EAAE,KAAK,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAC1G,OAAO,EAKH,gBAAgB,EACnB,MAAM,YAAY,CAAC;AAGpB,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACjC,0DAA0D;IAC1D,QAAQ,CAAC,GAAG,EAAE,UAAU,CAAC;IACzB,yDAAyD;IACzD,QAAQ,CAAC,eAAe,EAAE,OAAO,CAAC;IAClC,uGAAuG;IACv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;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,mBAAmB,GAAG,SAAS,GAAG,qBAAqB,CAMpG;AA+ID;;;;;;;;;;;;;GAaG;AACH,wBAAgB,cAAc,CAAC,CAAC,SAAS,mBAAmB,EAAE,OAAO,EAAE,CAAC,GAAG,SAAS,GAAG,CAAC,CAEvF;AAED;;;GAGG;AACH,eAAO,MAAM,eAAe,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAGtE,CAAC;AAEH;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,OAAO,CAK1E;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAU/C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Option
|
|
2
|
+
* Option normalization for importers and exporters (design sections 8.4 and 8.5): every common
|
|
3
3
|
* option resolved to its documented default, enum values checked (E_UNSUPPORTED, the core's
|
|
4
4
|
* convention for an option outside its set), and the per-format defaults (`ids`, `defaultDirected`,
|
|
5
5
|
* `weightFrom`, `addMissingNodes`) supplied by the importer that calls resolveImportOptions().
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
import { GraphFormatError } from "@graphty/graph-format";
|
|
8
8
|
import { AMBIGUOUS_GRAPH_NAME_CODE, GRAPH_NOT_FOUND_CODE, NO_GRAPH_CODE, OPTION_IGNORED_CODE, SINK_OPTION_CODE, } from "./codes.js";
|
|
9
9
|
import { canonicalEncoding } from "./input.js";
|
|
10
|
+
import { plural } from "./plural.js";
|
|
10
11
|
const ID_COERCIONS = new Set(["keep", "canonical", "string", "number"]);
|
|
11
12
|
const NODE_ID_SOURCES = new Set(["id", "label", "index"]);
|
|
12
13
|
const DUPLICATE_POLICIES = new Set(["keep", "error", "first", "last", "sum", "min", "max"]);
|
|
@@ -17,23 +18,27 @@ const WEIGHT_DTYPES = new Set(["f32", "f64"]);
|
|
|
17
18
|
const LONG_MODES = new Set(["f64", "string"]);
|
|
18
19
|
const HYPEREDGE_POLICIES = new Set(["error", "skip", "star", "clique"]);
|
|
19
20
|
const SANITIZE_MODES = new Set(["error", "mangle"]);
|
|
20
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* The default error limit: errors tolerated before an import aborts.
|
|
23
|
+
* @category Reports and errors
|
|
24
|
+
*/
|
|
21
25
|
export const DEFAULT_ERROR_LIMIT = 100;
|
|
22
26
|
export { SINK_OPTION_CODE };
|
|
23
27
|
/** The builder-policy options a sink exposes read-only as `sink.options` (design section 8.4). */
|
|
24
28
|
const SINK_OPTION_NAMES = ["addMissingNodes", "duplicateEdges", "selfLoops", "weightDtype"];
|
|
25
29
|
/**
|
|
26
|
-
* Report every builder-policy option the caller explicitly requested that the sink does not use
|
|
27
|
-
*
|
|
30
|
+
* Report every builder-policy option the caller explicitly requested that the sink does not use,
|
|
31
|
+
* one `W_SINK_OPTION` warning per option with the option name as
|
|
28
32
|
* the element. Options left undefined are never reported: they are defaults, not requests. On the
|
|
29
33
|
* registry's builder, which is seeded from the same options, nothing is ever reported.
|
|
30
34
|
* @param sink - the sink the importer pushes into
|
|
31
35
|
* @param options - the caller's raw options, possibly undefined
|
|
32
36
|
* @param report - the report to record into
|
|
33
37
|
* @param enforcesMissingNodes - true when the importer applies `addMissingNodes: false` itself (it
|
|
34
|
-
* refuses unknown endpoints before the sink sees them), so that request is
|
|
38
|
+
* refuses unknown endpoints before the sink sees them), so that request is honored on any sink and
|
|
35
39
|
* only `addMissingNodes: true` against a refusing sink is reported
|
|
36
40
|
* @returns the number of warnings recorded
|
|
41
|
+
* @category Writing a format
|
|
37
42
|
*/
|
|
38
43
|
export function reportSinkOptions(sink, options, report, enforcesMissingNodes = false) {
|
|
39
44
|
if (options === undefined) {
|
|
@@ -69,15 +74,27 @@ const IGNORABLE_OPTION_NAMES = [
|
|
|
69
74
|
"restoreMangledIds",
|
|
70
75
|
"hyperedges",
|
|
71
76
|
];
|
|
77
|
+
/** The defaults that are the same in every format (the others, such as `defaultDirected`, differ by format). */
|
|
78
|
+
const FIXED_DEFAULTS = {
|
|
79
|
+
nodeIdFrom: "id",
|
|
80
|
+
duplicateEdges: "keep",
|
|
81
|
+
selfLoops: "keep",
|
|
82
|
+
onMixedDirection: "expand",
|
|
83
|
+
weightDtype: "f64",
|
|
84
|
+
long: "f64",
|
|
85
|
+
restoreMangledIds: true,
|
|
86
|
+
hyperedges: "skip",
|
|
87
|
+
};
|
|
72
88
|
/**
|
|
73
89
|
* Report every common option the caller set to a non-default value that the format has no use
|
|
74
|
-
* for
|
|
90
|
+
* for: one
|
|
75
91
|
* `W_OPTION_IGNORED` warning (category `unsupported`) per option, the option name as the element.
|
|
76
92
|
* The builder-policy options are reportSinkOptions()'s and are skipped here.
|
|
77
93
|
* @param options - the caller's raw options, possibly undefined
|
|
78
94
|
* @param report - the report to record into
|
|
79
95
|
* @param used - the common option names the importer reads
|
|
80
96
|
* @returns the number of warnings recorded
|
|
97
|
+
* @category Writing a format
|
|
81
98
|
*/
|
|
82
99
|
export function reportUnusedOptions(options, report, used) {
|
|
83
100
|
if (options === undefined) {
|
|
@@ -89,7 +106,8 @@ export function reportUnusedOptions(options, report, used) {
|
|
|
89
106
|
continue;
|
|
90
107
|
}
|
|
91
108
|
const value = options[name];
|
|
92
|
-
if (value === undefined) {
|
|
109
|
+
if (value === undefined || value === FIXED_DEFAULTS[name]) {
|
|
110
|
+
// an option spelled out at its default changes nothing, whether or not the format reads it
|
|
93
111
|
continue;
|
|
94
112
|
}
|
|
95
113
|
report.warning("unsupported", OPTION_IGNORED_CODE, `option ${name}: ${JSON.stringify(value)} has no effect on the ${report.format} importer`, { element: name });
|
|
@@ -97,6 +115,27 @@ export function reportUnusedOptions(options, report, used) {
|
|
|
97
115
|
}
|
|
98
116
|
return recorded;
|
|
99
117
|
}
|
|
118
|
+
/**
|
|
119
|
+
* Whether the caller chose a graph with `graphIndex` or `graphName`. An importer warns
|
|
120
|
+
* W_MULTIPLE_GRAPHS about the graphs it skipped only when it read the first by default.
|
|
121
|
+
* @param options - the caller's graphIndex / graphName
|
|
122
|
+
* @returns true when either option is set
|
|
123
|
+
* @category Writing a format
|
|
124
|
+
*/
|
|
125
|
+
export function graphChosen(options) {
|
|
126
|
+
return options?.graphIndex !== undefined || options?.graphName !== undefined;
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* The graphs of an input as an E_GRAPH_NOT_FOUND message lists them: their indexes and names, so the
|
|
130
|
+
* caller can choose without a second call.
|
|
131
|
+
* @param names - each graph's name, null for an unnamed graph
|
|
132
|
+
* @returns the text to append, starting with "; "
|
|
133
|
+
*/
|
|
134
|
+
function graphNamesText(names) {
|
|
135
|
+
const shown = names.slice(0, 10).map((n, i) => `${i} ${n === null ? "(unnamed)" : JSON.stringify(n)}`);
|
|
136
|
+
const more = names.length > shown.length ? `, and ${names.length - shown.length} more` : "";
|
|
137
|
+
return `; the file holds ${shown.join(", ")}${more}`;
|
|
138
|
+
}
|
|
100
139
|
/**
|
|
101
140
|
* The graph an importer reads from an input that holds several: the one `graphIndex` or
|
|
102
141
|
* `graphName` names, else the first. A choice that names no graph is E_GRAPH_NOT_FOUND, a name two
|
|
@@ -106,6 +145,7 @@ export function reportUnusedOptions(options, report, used) {
|
|
|
106
145
|
* @param options - the caller's graphIndex / graphName
|
|
107
146
|
* @param report - the report a failure is recorded in
|
|
108
147
|
* @returns the index of the graph to read; E_UNSUPPORTED for an option of the wrong type, or both
|
|
148
|
+
* @category Writing a format
|
|
109
149
|
*/
|
|
110
150
|
export function chooseGraph(names, options, report) {
|
|
111
151
|
const { graphIndex, graphName } = options ?? {};
|
|
@@ -137,22 +177,23 @@ export function chooseGraph(names, options, report) {
|
|
|
137
177
|
return report.fail(AMBIGUOUS_GRAPH_NAME_CODE, `graphName ${JSON.stringify(graphName)} names the graphs at indexes ${matches.join(", ")}; pass graphIndex`, { element: graphName });
|
|
138
178
|
}
|
|
139
179
|
if (matches.length === 0) {
|
|
140
|
-
return report.fail(GRAPH_NOT_FOUND_CODE, `graphName ${JSON.stringify(graphName)} names none of the ${names.length} graph(
|
|
180
|
+
return report.fail(GRAPH_NOT_FOUND_CODE, `graphName ${JSON.stringify(graphName)} names none of the ${names.length} graph${plural(names.length)}${graphNamesText(names)}`, { element: graphName }, { names: [...names] });
|
|
141
181
|
}
|
|
142
182
|
return matches[0];
|
|
143
183
|
}
|
|
144
184
|
const index = graphIndex ?? 0;
|
|
145
185
|
if (index >= names.length) {
|
|
146
|
-
return report.fail(GRAPH_NOT_FOUND_CODE, `graphIndex ${index} is beyond the ${names.length} graph(
|
|
186
|
+
return report.fail(GRAPH_NOT_FOUND_CODE, `graphIndex ${index} is beyond the ${names.length} graph${plural(names.length)}${graphNamesText(names)}`);
|
|
147
187
|
}
|
|
148
188
|
return index;
|
|
149
189
|
}
|
|
150
190
|
/**
|
|
151
|
-
* Apply the
|
|
191
|
+
* Apply the documented defaults to an importer's common options and check every enum
|
|
152
192
|
* value. Format-specific options in the same object are ignored here.
|
|
153
193
|
* @param options - the caller's options, possibly undefined
|
|
154
194
|
* @param defaults - the importer's per-format defaults
|
|
155
195
|
* @returns the resolved options; E_UNSUPPORTED for a value outside its set
|
|
196
|
+
* @category Writing a format
|
|
156
197
|
*/
|
|
157
198
|
export function resolveImportOptions(options, defaults) {
|
|
158
199
|
const o = options ?? {};
|
|
@@ -176,9 +217,10 @@ export function resolveImportOptions(options, defaults) {
|
|
|
176
217
|
});
|
|
177
218
|
}
|
|
178
219
|
/**
|
|
179
|
-
* Apply the
|
|
220
|
+
* Apply the documented defaults to an exporter's common options and check the enum values.
|
|
180
221
|
* @param options - the caller's options, possibly undefined
|
|
181
222
|
* @returns the resolved options; E_UNSUPPORTED for a value outside its set
|
|
223
|
+
* @category Writing a format
|
|
182
224
|
*/
|
|
183
225
|
export function resolveExportOptions(options) {
|
|
184
226
|
const o = options ?? {};
|
|
@@ -305,10 +347,46 @@ function encodingOption(value) {
|
|
|
305
347
|
}
|
|
306
348
|
return canonical;
|
|
307
349
|
}
|
|
350
|
+
/**
|
|
351
|
+
* The options to pass to another importer that you hand text you already decoded with readText():
|
|
352
|
+
* the caller's options without `encoding` and `onProgress`, which that text no longer needs. Without
|
|
353
|
+
* this, the other importer would warn that `encoding` has no effect on text, and report progress a
|
|
354
|
+
* second time.
|
|
355
|
+
* @example
|
|
356
|
+
* ```ts
|
|
357
|
+
* const text = await readText(input, report, opts);
|
|
358
|
+
* report.include(await csvImporter.import(text, sink, forDecodedText(options)));
|
|
359
|
+
* ```
|
|
360
|
+
* @param options - the caller's import options
|
|
361
|
+
* @returns a copy without `encoding` and `onProgress`
|
|
362
|
+
* @category Writing a format
|
|
363
|
+
*/
|
|
364
|
+
export function forDecodedText(options) {
|
|
365
|
+
return { ...options, encoding: undefined, onProgress: undefined };
|
|
366
|
+
}
|
|
367
|
+
/**
|
|
368
|
+
* The dialect names of the built-in formats with a `dialect` save option. One options object shared between formats
|
|
369
|
+
* can hold one format's dialect, and the other formats ignore it, as they ignore any option they do not have.
|
|
370
|
+
*/
|
|
371
|
+
export const FORMAT_DIALECTS = Object.freeze({
|
|
372
|
+
csv: Object.freeze(["gephi", "generic"]),
|
|
373
|
+
json: Object.freeze(["node-link", "d3", "jgf", "cytoscape", "graphology", "vis", "obographs"]),
|
|
374
|
+
});
|
|
375
|
+
/**
|
|
376
|
+
* Whether a `dialect` value names another format's dialect, which this format ignores rather than refuses.
|
|
377
|
+
* @param format - this format
|
|
378
|
+
* @param value - the caller's `dialect` option
|
|
379
|
+
* @returns true for another built-in format's dialect name
|
|
380
|
+
*/
|
|
381
|
+
export function otherFormatDialect(format, value) {
|
|
382
|
+
return (typeof value === "string" &&
|
|
383
|
+
Object.entries(FORMAT_DIALECTS).some(([f, names]) => f !== format && names.includes(value)));
|
|
384
|
+
}
|
|
308
385
|
/**
|
|
309
386
|
* A short description of an option value for an error message.
|
|
310
387
|
* @param value - the value
|
|
311
388
|
* @returns the JSON text of a primitive, or the type name otherwise
|
|
389
|
+
* @category Plugin helpers
|
|
312
390
|
*/
|
|
313
391
|
export function describe(value) {
|
|
314
392
|
switch (typeof value) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/common/options.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAwB,gBAAgB,EAAmC,MAAM,uBAAuB,CAAC;AAGhH,OAAO,EACH,yBAAyB,EACzB,oBAAoB,EACpB,aAAa,EACb,mBAAmB,EACnB,gBAAgB,GACnB,MAAM,YAAY,CAAC;AACpB,OAAO,EAAE,iBAAiB,EAAE,MAAM,YAAY,CAAC;AA+D/C,MAAM,YAAY,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC;AAC7F,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAC,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC;AAC/E,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC;AACjH,MAAM,kBAAkB,GAAwB,IAAI,GAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;AACnF,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC,CAAC;AAC1G,MAAM,qBAAqB,GAAwB,IAAI,GAAG,CAAC,CAAC,OAAO,EAAE,UAAU,EAAE,YAAY,CAAC,CAAC,CAAC;AAChG,MAAM,aAAa,GAAwB,IAAI,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC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IAAI,CAAC,OAA4B;IACtC,OAAO,CAAC,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACjE,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Count agreement for messages, so a report says "1 node is" and "3 nodes are", never "1 node(s) are".
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The plural ending of a regular noun after a count.
|
|
6
|
+
* @param n - the count
|
|
7
|
+
* @returns "" for 1, "s" otherwise
|
|
8
|
+
*/
|
|
9
|
+
export declare function plural(n: number): string;
|
|
10
|
+
/**
|
|
11
|
+
* The form of a verb that agrees with a count.
|
|
12
|
+
* @param n - the count
|
|
13
|
+
* @param one - the form for 1 ("is", "was", "holds")
|
|
14
|
+
* @param many - the form for any other count ("are", "were", "hold")
|
|
15
|
+
* @returns `one` or `many`
|
|
16
|
+
*/
|
|
17
|
+
export declare function agree(n: number, one: string, many: string): string;
|
|
18
|
+
/**
|
|
19
|
+
* A count of nodes and edges, leaving out a zero: "2 nodes and 1 edge", "1 edge".
|
|
20
|
+
* @param nodes - the node count
|
|
21
|
+
* @param edges - the edge count
|
|
22
|
+
* @returns the text
|
|
23
|
+
*/
|
|
24
|
+
export declare function elementCount(nodes: number, edges: number): string;
|
|
25
|
+
/**
|
|
26
|
+
* A word with its indefinite article, chosen by its first letter: "an integer", "a double".
|
|
27
|
+
* @param word - the word
|
|
28
|
+
* @returns "a word" or "an word"
|
|
29
|
+
*/
|
|
30
|
+
export declare function withArticle(word: string): string;
|
|
31
|
+
//# sourceMappingURL=plural.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plural.d.ts","sourceRoot":"","sources":["../../../src/common/plural.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAExC;AAED;;;;;;GAMG;AACH,wBAAgB,KAAK,CAAC,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAElE;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CASjE;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Count agreement for messages, so a report says "1 node is" and "3 nodes are", never "1 node(s) are".
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* The plural ending of a regular noun after a count.
|
|
6
|
+
* @param n - the count
|
|
7
|
+
* @returns "" for 1, "s" otherwise
|
|
8
|
+
*/
|
|
9
|
+
export function plural(n) {
|
|
10
|
+
return n === 1 ? "" : "s";
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The form of a verb that agrees with a count.
|
|
14
|
+
* @param n - the count
|
|
15
|
+
* @param one - the form for 1 ("is", "was", "holds")
|
|
16
|
+
* @param many - the form for any other count ("are", "were", "hold")
|
|
17
|
+
* @returns `one` or `many`
|
|
18
|
+
*/
|
|
19
|
+
export function agree(n, one, many) {
|
|
20
|
+
return n === 1 ? one : many;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* A count of nodes and edges, leaving out a zero: "2 nodes and 1 edge", "1 edge".
|
|
24
|
+
* @param nodes - the node count
|
|
25
|
+
* @param edges - the edge count
|
|
26
|
+
* @returns the text
|
|
27
|
+
*/
|
|
28
|
+
export function elementCount(nodes, edges) {
|
|
29
|
+
const parts = [];
|
|
30
|
+
if (nodes > 0 || edges === 0) {
|
|
31
|
+
parts.push(`${nodes} node${plural(nodes)}`);
|
|
32
|
+
}
|
|
33
|
+
if (edges > 0) {
|
|
34
|
+
parts.push(`${edges} edge${plural(edges)}`);
|
|
35
|
+
}
|
|
36
|
+
return parts.join(" and ");
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A word with its indefinite article, chosen by its first letter: "an integer", "a double".
|
|
40
|
+
* @param word - the word
|
|
41
|
+
* @returns "a word" or "an word"
|
|
42
|
+
*/
|
|
43
|
+
export function withArticle(word) {
|
|
44
|
+
return `${/^[aeiou]/i.test(word) ? "an" : "a"} ${word}`;
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=plural.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plural.js","sourceRoot":"","sources":["../../../src/common/plural.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,CAAS;IAC5B,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC;AAC9B,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,KAAK,CAAC,CAAS,EAAE,GAAW,EAAE,IAAY;IACtD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAC;AAChC,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,KAAa,EAAE,KAAa;IACrD,MAAM,KAAK,GAAG,EAAE,CAAC;IACjB,IAAI,KAAK,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,EAAE,CAAC;QAC3B,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,QAAQ,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;QACZ,KAAK,CAAC,IAAI,CAAC,GAAG,KAAK,QAAQ,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAChD,CAAC;IACD,OAAO,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,IAAY;IACpC,OAAO,GAAG,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,EAAE,CAAC;AAC5D,CAAC"}
|