@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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"temporal.js","sourceRoot":"","sources":["../../../src/common/temporal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAoC,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"temporal.js","sourceRoot":"","sources":["../../../src/common/temporal.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAoC,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AA0B3F;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAe,UAAU,CAAC;AAErD;;;GAGG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAG,OAAO,CAAC;AAExC,MAAM,SAAS,GACX,0IAA0I,CAAC;AAC/I,MAAM,IAAI,GAAG,8FAA8F,CAAC;AAC5G,MAAM,OAAO,GAAG,uDAAuD,CAAC;AAExE,MAAM,aAAa,GAAG,KAAM,CAAC;AAC7B,MAAM,UAAU,GAAG,QAAU,CAAC;AAE9B;;;;;;GAMG;AACH,M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I,CAAC,CAAC,CAAC,GAAG,IAAI,IAAI,MAAM,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAAC;AACtE,CAAC"}
|
|
@@ -15,15 +15,22 @@
|
|
|
15
15
|
import { type ColumnHandle, type GraphSink } from "@graphty/graph-format";
|
|
16
16
|
import { type ImportReportBuilder } from "./report.js";
|
|
17
17
|
/**
|
|
18
|
-
* The dtype a text cell parses as under the
|
|
19
|
-
* Consumed by the per-format importers and exporters under src/formats.
|
|
18
|
+
* The dtype a text cell parses as under the fixed text grammar.
|
|
20
19
|
* @public
|
|
20
|
+
* @category Plugin helpers
|
|
21
21
|
*/
|
|
22
22
|
export type TextDtype = "bool" | "i32" | "f64" | "string";
|
|
23
|
+
/**
|
|
24
|
+
* A digit string without its trailing zeros (`"1200"` becomes `"12"`).
|
|
25
|
+
* @param digits - the digits
|
|
26
|
+
* @returns the digits up to the last one that is not 0
|
|
27
|
+
*/
|
|
28
|
+
export declare function trimTrailingZeros(digits: string): string;
|
|
23
29
|
/**
|
|
24
30
|
* Classify one text cell by the fixed grammar.
|
|
25
31
|
* @param text - the cell text, exactly as read (no trimming)
|
|
26
32
|
* @returns bool, i32, f64 or string
|
|
33
|
+
* @category Plugin helpers
|
|
27
34
|
*/
|
|
28
35
|
export declare function inferTextDtype(text: string): TextDtype;
|
|
29
36
|
/**
|
|
@@ -31,29 +38,34 @@ export declare function inferTextDtype(text: string): TextDtype;
|
|
|
31
38
|
* i32 / f64, the text itself for string. The sink infers the column dtype from the value.
|
|
32
39
|
* @param text - the cell text, exactly as read
|
|
33
40
|
* @returns the value
|
|
41
|
+
* @category Plugin helpers
|
|
34
42
|
*/
|
|
35
43
|
export declare function parseTextCell(text: string): boolean | number | string;
|
|
36
44
|
/**
|
|
37
45
|
* Whether a text cell is a number under the f64 grammar (an i32 or f64 literal).
|
|
38
46
|
* @param text - the cell text
|
|
39
47
|
* @returns true when parseTextCell(text) returns a number
|
|
48
|
+
* @category Plugin helpers
|
|
40
49
|
*/
|
|
41
50
|
export declare function isNumericText(text: string): boolean;
|
|
42
51
|
/**
|
|
43
|
-
*
|
|
44
|
-
*
|
|
45
|
-
*
|
|
52
|
+
* Writes the cells of one attribute of a text format whose values carry no type (CSV, DOT, Pajek):
|
|
53
|
+
* you hand it each cell's text and it stores a number, a boolean or text, choosing one type for the
|
|
54
|
+
* whole attribute. A column of `2.0`, `3.5` stays a number column with decimals even though `2.0`
|
|
55
|
+
* alone looks like an integer, and once one cell turns out to be text, earlier cells such as `1e5`
|
|
56
|
+
* are kept as written instead of as `100000`. Create one writer per attribute name and per kind
|
|
57
|
+
* ("node" or "edge"), and call `write(index, text)` with the node or edge index the sink gave you:
|
|
46
58
|
*
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
* back, so the lexical form is never rewritten by the widening.
|
|
59
|
+
* ```ts
|
|
60
|
+
* const color = new TextCellWriter("color", "node", sink, report);
|
|
61
|
+
* color.write(sink.addNode("a"), "red");
|
|
62
|
+
* ```
|
|
52
63
|
*
|
|
53
|
-
* A sink
|
|
54
|
-
* one W_WIDENING_UNSUPPORTED warning
|
|
55
|
-
*
|
|
64
|
+
* A sink that cannot change a column's type after the fact (one of your own without
|
|
65
|
+
* `widenNodeColumn` / `widenEdgeColumn`) keeps the type the first values implied, with one W_WIDENING_UNSUPPORTED warning
|
|
66
|
+
* per attribute.
|
|
56
67
|
* @public
|
|
68
|
+
* @category Writing a format
|
|
57
69
|
*/
|
|
58
70
|
export declare class TextCellWriter {
|
|
59
71
|
/** The column name in the sink. */
|
|
@@ -69,22 +81,22 @@ export declare class TextCellWriter {
|
|
|
69
81
|
private readonly keptRows;
|
|
70
82
|
private readonly keptTexts;
|
|
71
83
|
/**
|
|
72
|
-
* Create a writer
|
|
73
|
-
* @param name - the
|
|
74
|
-
* @param domain - node
|
|
75
|
-
* @param sink - the sink
|
|
76
|
-
* @param report - the report
|
|
84
|
+
* Create a writer. The attribute is added to the sink on the first write.
|
|
85
|
+
* @param name - the attribute name
|
|
86
|
+
* @param domain - "node" for a node attribute, "edge" for an edge attribute
|
|
87
|
+
* @param sink - the sink the importer fills
|
|
88
|
+
* @param report - the import report, for warnings about the values
|
|
77
89
|
*/
|
|
78
90
|
constructor(name: string, domain: "node" | "edge", sink: GraphSink, report: ImportReportBuilder);
|
|
79
91
|
/**
|
|
80
|
-
* The
|
|
92
|
+
* The sink's handle of the attribute's column, for reading it back.
|
|
81
93
|
* @returns the handle, or INVALID_INDEX before the first write
|
|
82
94
|
*/
|
|
83
95
|
get column(): ColumnHandle;
|
|
84
96
|
/**
|
|
85
|
-
* Write one cell
|
|
86
|
-
* @param row - the node or edge index
|
|
87
|
-
* @param text - the cell text, exactly as read
|
|
97
|
+
* Write one cell.
|
|
98
|
+
* @param row - the node or edge index, as the sink's addNode() or addEdge() returned it
|
|
99
|
+
* @param text - the cell text, exactly as read from the file
|
|
88
100
|
*/
|
|
89
101
|
write(row: number, text: string): void;
|
|
90
102
|
/**
|
|
@@ -99,6 +111,10 @@ export declare class TextCellWriter {
|
|
|
99
111
|
*/
|
|
100
112
|
private widen;
|
|
101
113
|
}
|
|
102
|
-
/**
|
|
114
|
+
/**
|
|
115
|
+
* Your graph builder cannot change an attribute's type after its first value, so a text column keeps the type of its
|
|
116
|
+
* first values.
|
|
117
|
+
* @category Issue and loss codes
|
|
118
|
+
*/
|
|
103
119
|
export declare const WIDENING_UNSUPPORTED_CODE = "W_WIDENING_UNSUPPORTED";
|
|
104
120
|
//# sourceMappingURL=text.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.d.ts","sourceRoot":"","sources":["../../../src/common/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,KAAK,YAAY,EAAoB,KAAK,SAAS,EAAiB,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"text.d.ts","sourceR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;IAO/F;;;OAGG;IACH,IAAI,MAAM,IAAI,YAAY,CAEzB;IAED;;;;OAIG;IACH,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAmDtC;;;;OAIG;IACH,OAAO,CAAC,GAAG;IAkBX;;;OAGG;IACH,OAAO,CAAC,KAAK;CA6BhB;AAED;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,2BAA2B,CAAC"}
|
package/dist/src/common/text.js
CHANGED
|
@@ -13,14 +13,28 @@
|
|
|
13
13
|
* - everything else is `string`.
|
|
14
14
|
*/
|
|
15
15
|
import { GraphFormatError, INVALID_INDEX } from "@graphty/graph-format";
|
|
16
|
+
import { PRECISION_CODE } from "./codes.js";
|
|
16
17
|
const I32_TEXT = /^-?(0|[1-9][0-9]*)$/;
|
|
17
18
|
const F64_TEXT = /^[+-]?((0|[1-9][0-9]*)(\.[0-9]*)?|\.[0-9]+)([eE][+-]?[0-9]+)?$/;
|
|
18
19
|
const I32_MIN = -2147483648;
|
|
19
20
|
const I32_MAX = 2147483647;
|
|
21
|
+
/**
|
|
22
|
+
* A digit string without its trailing zeros (`"1200"` becomes `"12"`).
|
|
23
|
+
* @param digits - the digits
|
|
24
|
+
* @returns the digits up to the last one that is not 0
|
|
25
|
+
*/
|
|
26
|
+
export function trimTrailingZeros(digits) {
|
|
27
|
+
let end = digits.length;
|
|
28
|
+
while (end > 0 && digits[end - 1] === "0") {
|
|
29
|
+
end--;
|
|
30
|
+
}
|
|
31
|
+
return digits.slice(0, end);
|
|
32
|
+
}
|
|
20
33
|
/**
|
|
21
34
|
* Classify one text cell by the fixed grammar.
|
|
22
35
|
* @param text - the cell text, exactly as read (no trimming)
|
|
23
36
|
* @returns bool, i32, f64 or string
|
|
37
|
+
* @category Plugin helpers
|
|
24
38
|
*/
|
|
25
39
|
export function inferTextDtype(text) {
|
|
26
40
|
if (text === "true" || text === "false") {
|
|
@@ -43,6 +57,7 @@ export function inferTextDtype(text) {
|
|
|
43
57
|
* i32 / f64, the text itself for string. The sink infers the column dtype from the value.
|
|
44
58
|
* @param text - the cell text, exactly as read
|
|
45
59
|
* @returns the value
|
|
60
|
+
* @category Plugin helpers
|
|
46
61
|
*/
|
|
47
62
|
export function parseTextCell(text) {
|
|
48
63
|
switch (inferTextDtype(text)) {
|
|
@@ -61,6 +76,7 @@ export function parseTextCell(text) {
|
|
|
61
76
|
* Whether a text cell is a number under the f64 grammar (an i32 or f64 literal).
|
|
62
77
|
* @param text - the cell text
|
|
63
78
|
* @returns true when parseTextCell(text) returns a number
|
|
79
|
+
* @category Plugin helpers
|
|
64
80
|
*/
|
|
65
81
|
export function isNumericText(text) {
|
|
66
82
|
const dtype = inferTextDtype(text);
|
|
@@ -98,28 +114,31 @@ function textDtypeRank(dtype) {
|
|
|
98
114
|
}
|
|
99
115
|
}
|
|
100
116
|
/**
|
|
101
|
-
*
|
|
102
|
-
*
|
|
103
|
-
*
|
|
117
|
+
* Writes the cells of one attribute of a text format whose values carry no type (CSV, DOT, Pajek):
|
|
118
|
+
* you hand it each cell's text and it stores a number, a boolean or text, choosing one type for the
|
|
119
|
+
* whole attribute. A column of `2.0`, `3.5` stays a number column with decimals even though `2.0`
|
|
120
|
+
* alone looks like an integer, and once one cell turns out to be text, earlier cells such as `1e5`
|
|
121
|
+
* are kept as written instead of as `100000`. Create one writer per attribute name and per kind
|
|
122
|
+
* ("node" or "edge"), and call `write(index, text)` with the node or edge index the sink gave you:
|
|
104
123
|
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
* back, so the lexical form is never rewritten by the widening.
|
|
124
|
+
* ```ts
|
|
125
|
+
* const color = new TextCellWriter("color", "node", sink, report);
|
|
126
|
+
* color.write(sink.addNode("a"), "red");
|
|
127
|
+
* ```
|
|
110
128
|
*
|
|
111
|
-
* A sink
|
|
112
|
-
* one W_WIDENING_UNSUPPORTED warning
|
|
113
|
-
*
|
|
129
|
+
* A sink that cannot change a column's type after the fact (one of your own without
|
|
130
|
+
* `widenNodeColumn` / `widenEdgeColumn`) keeps the type the first values implied, with one W_WIDENING_UNSUPPORTED warning
|
|
131
|
+
* per attribute.
|
|
114
132
|
* @public
|
|
133
|
+
* @category Writing a format
|
|
115
134
|
*/
|
|
116
135
|
export class TextCellWriter {
|
|
117
136
|
/**
|
|
118
|
-
* Create a writer
|
|
119
|
-
* @param name - the
|
|
120
|
-
* @param domain - node
|
|
121
|
-
* @param sink - the sink
|
|
122
|
-
* @param report - the report
|
|
137
|
+
* Create a writer. The attribute is added to the sink on the first write.
|
|
138
|
+
* @param name - the attribute name
|
|
139
|
+
* @param domain - "node" for a node attribute, "edge" for an edge attribute
|
|
140
|
+
* @param sink - the sink the importer fills
|
|
141
|
+
* @param report - the import report, for warnings about the values
|
|
123
142
|
*/
|
|
124
143
|
constructor(name, domain, sink, report) {
|
|
125
144
|
this.handle = INVALID_INDEX;
|
|
@@ -135,20 +154,27 @@ export class TextCellWriter {
|
|
|
135
154
|
this.report = report;
|
|
136
155
|
}
|
|
137
156
|
/**
|
|
138
|
-
* The
|
|
157
|
+
* The sink's handle of the attribute's column, for reading it back.
|
|
139
158
|
* @returns the handle, or INVALID_INDEX before the first write
|
|
140
159
|
*/
|
|
141
160
|
get column() {
|
|
142
161
|
return this.handle;
|
|
143
162
|
}
|
|
144
163
|
/**
|
|
145
|
-
* Write one cell
|
|
146
|
-
* @param row - the node or edge index
|
|
147
|
-
* @param text - the cell text, exactly as read
|
|
164
|
+
* Write one cell.
|
|
165
|
+
* @param row - the node or edge index, as the sink's addNode() or addEdge() returned it
|
|
166
|
+
* @param text - the cell text, exactly as read from the file
|
|
148
167
|
*/
|
|
149
168
|
write(row, text) {
|
|
150
169
|
const kind = inferTextDtype(text);
|
|
151
170
|
const value = parseTextCell(text);
|
|
171
|
+
if (typeof value === "number" &&
|
|
172
|
+
!Number.isSafeInteger(value) &&
|
|
173
|
+
I32_TEXT.test(text) &&
|
|
174
|
+
BigInt(text) !== BigInt(value)) {
|
|
175
|
+
// an integer beyond 2^53 is stored as the nearest double; say so once per column
|
|
176
|
+
this.report.warnOnce("precision", PRECISION_CODE, `${this.domain} column "${this.name}": integers beyond 2^53 are stored as the nearest double (first: ${text})`, { element: this.name }, `${PRECISION_CODE}:${this.domain}:${this.name}`);
|
|
177
|
+
}
|
|
152
178
|
const wasString = this.textDtype === "string";
|
|
153
179
|
const textDtype = this.textDtype === null || textDtypeRank(kind) > textDtypeRank(this.textDtype) ? kind : this.textDtype;
|
|
154
180
|
// a string column keeps every cell's lexical form; a numeric text is never re-spelled. The
|
|
@@ -234,7 +260,11 @@ export class TextCellWriter {
|
|
|
234
260
|
}
|
|
235
261
|
}
|
|
236
262
|
}
|
|
237
|
-
/**
|
|
263
|
+
/**
|
|
264
|
+
* Your graph builder cannot change an attribute's type after its first value, so a text column keeps the type of its
|
|
265
|
+
* first values.
|
|
266
|
+
* @category Issue and loss codes
|
|
267
|
+
*/
|
|
238
268
|
export const WIDENING_UNSUPPORTED_CODE = "W_WIDENING_UNSUPPORTED";
|
|
239
269
|
/**
|
|
240
270
|
* The text dtype a parsed cell value implies on its own (what the sink's inference sees). It must
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/common/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAqB,gBAAgB,EAAkB,aAAa,EAAE,MAAM,uBAAuB,CAAC;
|
|
1
|
+
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/common/text.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAqB,gBAAgB,EAAkB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAE3G,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAG5C,MAAM,QAAQ,GAAG,qBAAqB,CAAC;AACvC,MAAM,QAAQ,GAAG,gEAAgE,CAAC;AAClF,MAAM,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U,IAAI,KAAK,IAAI,UAAU,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAClG,CAAC"}
|
|
@@ -10,36 +10,53 @@
|
|
|
10
10
|
* with the sink unchanged; Infinity and negative values are legal weights (design section 3.7).
|
|
11
11
|
*/
|
|
12
12
|
import { type GraphSnapshot } from "@graphty/graph-format";
|
|
13
|
-
|
|
13
|
+
import { type ImportReportBuilder } from "./report.js";
|
|
14
|
+
/**
|
|
15
|
+
* The weight of an edge added without one (design section 3.7).
|
|
16
|
+
* @category Plugin helpers
|
|
17
|
+
*/
|
|
14
18
|
export declare const DEFAULT_WEIGHT = 1;
|
|
15
19
|
/**
|
|
16
20
|
* Whether a source field is the weight field under the resolved `weightFrom` option.
|
|
17
21
|
* @param name - the field name (attribute title, CSV header, JSON key)
|
|
18
22
|
* @param weightFrom - the resolved option; null means unweighted
|
|
19
23
|
* @returns true when the field is THE weight
|
|
24
|
+
* @category Plugin helpers
|
|
20
25
|
*/
|
|
21
26
|
export declare function isWeightField(name: string, weightFrom: string | null): boolean;
|
|
22
27
|
/**
|
|
23
28
|
* The weight argument of addEdge from a text cell: undefined for a blank cell (the weight is
|
|
24
29
|
* omitted), the number otherwise.
|
|
25
30
|
* @param text - the cell text
|
|
31
|
+
* @param report - the import report; when given, an integer beyond 2^53 that the nearest double
|
|
32
|
+
* changes is reported once as W_PRECISION
|
|
26
33
|
* @returns the weight, or undefined when blank; E_INVALID_WEIGHT for NaN or non-numeric text
|
|
34
|
+
* @category Writing a format
|
|
35
|
+
*/
|
|
36
|
+
export declare function parseWeightText(text: string, report?: ImportReportBuilder): number | undefined;
|
|
37
|
+
/**
|
|
38
|
+
* Report once (W_PRECISION) an integer weight beyond 2^53 that the nearest double changes, which
|
|
39
|
+
* the weights and the exact `graphty.weight` column would otherwise hold silently.
|
|
40
|
+
* @param text - the weight as written in the file
|
|
41
|
+
* @param value - the number it was read as
|
|
42
|
+
* @param report - the import report
|
|
27
43
|
*/
|
|
28
|
-
export declare function
|
|
44
|
+
export declare function reportWeightPrecision(text: string, value: number, report: ImportReportBuilder): void;
|
|
29
45
|
/**
|
|
30
46
|
* The weight argument of addEdge from a typed value (JSON, a record field): undefined for null /
|
|
31
47
|
* undefined, the number for a finite or infinite number, the parsed number for numeric text.
|
|
32
48
|
* @param value - the field value
|
|
33
49
|
* @returns the weight, or undefined when absent; E_INVALID_WEIGHT for NaN, a boolean, an object or non-numeric text
|
|
50
|
+
* @category Plugin helpers
|
|
34
51
|
*/
|
|
35
52
|
export declare function weightFromValue(value: unknown): number | undefined;
|
|
36
53
|
/**
|
|
37
|
-
* The explicit weights of a snapshot for exporters
|
|
54
|
+
* The explicit weights of a snapshot for exporters: the weight
|
|
38
55
|
* role column when present (its validity says which edges had an explicit weight, its dtype how
|
|
39
56
|
* the value is written), else `edgeList().weights` as f32 for every edge of a weighted snapshot;
|
|
40
57
|
* nothing for an unweighted one. One implementation for every exporter.
|
|
41
|
-
* Consumed by the per-format exporters under src/formats.
|
|
42
58
|
* @public
|
|
59
|
+
* @category Plugin helpers
|
|
43
60
|
*/
|
|
44
61
|
export interface ExplicitWeights {
|
|
45
62
|
/** Whether any edge can have an explicit weight (the snapshot is weighted). */
|
|
@@ -72,6 +89,22 @@ export interface ExplicitWeights {
|
|
|
72
89
|
* Build the explicit-weight view of a snapshot.
|
|
73
90
|
* @param snapshot - the snapshot
|
|
74
91
|
* @returns the view
|
|
92
|
+
* @category Writing a format
|
|
75
93
|
*/
|
|
76
94
|
export declare function explicitWeights(snapshot: GraphSnapshot): ExplicitWeights;
|
|
95
|
+
/**
|
|
96
|
+
* The weight of every edge, in edge order (`weights[e]` is edge `e`'s weight), exactly as the file
|
|
97
|
+
* wrote it, or null for a graph without weights. `snapshot.edgeList().weights` holds the same
|
|
98
|
+
* weights as 32-bit floats, in which 0.1 reads back as 0.10000000149011612; this reads the exact
|
|
99
|
+
* values the import also kept. An edge without a weight of its own has the weight 1.
|
|
100
|
+
* @example
|
|
101
|
+
* ```ts
|
|
102
|
+
* const { snapshot } = await importGraph("source,target,weight\na,b,0.1\n", { format: "csv" });
|
|
103
|
+
* edgeWeights(snapshot); // Float64Array [ 0.1 ]
|
|
104
|
+
* ```
|
|
105
|
+
* @param snapshot - the graph
|
|
106
|
+
* @returns one weight per edge, or null when the graph has no weights
|
|
107
|
+
* @category Loading
|
|
108
|
+
*/
|
|
109
|
+
export declare function edgeWeights(snapshot: GraphSnapshot): Float64Array | null;
|
|
77
110
|
//# sourceMappingURL=weights.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weights.d.ts","sourceRoot":"","sources":["../../../src/common/weights.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAiC,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK1F,
|
|
1
|
+
{"version":3,"file":"weights.d.ts","sourceRoot":"","sources":["../../../src/common/weights.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAiC,KAAK,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAK1F,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD;;;GAGG;AACH,eAAO,MAAM,cAAc,IAAI,CAAC;AAEhC;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAE9E;AAED;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,mBAAmB,GAAG,MAAM,GAAG,SAAS,CAkB9F;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,mBAAmB,GAAG,IAAI,CAepG;AAED;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAclE;AA4BD;;;;;;;GAOG;AACH,MAAM,WAAW,eAAe;IAC5B,+EAA+E;IAC/E,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,KAAK,EAAE,KAAK,GAAG,KAAK,CAAC;IAC9B;;;;OAIG;IACH,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B;;;;OAIG;IACH,KAAK,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IACzB;;;;;;;OAOG;IACH,IAAI,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;CACtD;AAwBD;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,QAAQ,EAAE,aAAa,GAAG,eAAe,CA8CxE;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,QAAQ,EAAE,aAAa,GAAG,YAAY,GAAG,IAAI,CAgBxE"}
|
|
@@ -10,15 +10,20 @@
|
|
|
10
10
|
* with the sink unchanged; Infinity and negative values are legal weights (design section 3.7).
|
|
11
11
|
*/
|
|
12
12
|
import { GraphFormatError } from "@graphty/graph-format";
|
|
13
|
+
import { PRECISION_CODE } from "./codes.js";
|
|
13
14
|
import { parseDecimalText } from "./declared-types.js";
|
|
14
15
|
import { formatF32, formatF64, formatInteger } from "./format.js";
|
|
15
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The weight of an edge added without one (design section 3.7).
|
|
18
|
+
* @category Plugin helpers
|
|
19
|
+
*/
|
|
16
20
|
export const DEFAULT_WEIGHT = 1;
|
|
17
21
|
/**
|
|
18
22
|
* Whether a source field is the weight field under the resolved `weightFrom` option.
|
|
19
23
|
* @param name - the field name (attribute title, CSV header, JSON key)
|
|
20
24
|
* @param weightFrom - the resolved option; null means unweighted
|
|
21
25
|
* @returns true when the field is THE weight
|
|
26
|
+
* @category Plugin helpers
|
|
22
27
|
*/
|
|
23
28
|
export function isWeightField(name, weightFrom) {
|
|
24
29
|
return weightFrom !== null && name === weightFrom;
|
|
@@ -27,9 +32,12 @@ export function isWeightField(name, weightFrom) {
|
|
|
27
32
|
* The weight argument of addEdge from a text cell: undefined for a blank cell (the weight is
|
|
28
33
|
* omitted), the number otherwise.
|
|
29
34
|
* @param text - the cell text
|
|
35
|
+
* @param report - the import report; when given, an integer beyond 2^53 that the nearest double
|
|
36
|
+
* changes is reported once as W_PRECISION
|
|
30
37
|
* @returns the weight, or undefined when blank; E_INVALID_WEIGHT for NaN or non-numeric text
|
|
38
|
+
* @category Writing a format
|
|
31
39
|
*/
|
|
32
|
-
export function parseWeightText(text) {
|
|
40
|
+
export function parseWeightText(text, report) {
|
|
33
41
|
const trimmed = text.trim();
|
|
34
42
|
if (trimmed.length === 0) {
|
|
35
43
|
return undefined;
|
|
@@ -44,13 +52,32 @@ export function parseWeightText(text) {
|
|
|
44
52
|
if (Number.isNaN(value)) {
|
|
45
53
|
throw invalidWeight(text, null);
|
|
46
54
|
}
|
|
55
|
+
if (report !== undefined) {
|
|
56
|
+
reportWeightPrecision(trimmed, value, report);
|
|
57
|
+
}
|
|
47
58
|
return value;
|
|
48
59
|
}
|
|
60
|
+
/**
|
|
61
|
+
* Report once (W_PRECISION) an integer weight beyond 2^53 that the nearest double changes, which
|
|
62
|
+
* the weights and the exact `graphty.weight` column would otherwise hold silently.
|
|
63
|
+
* @param text - the weight as written in the file
|
|
64
|
+
* @param value - the number it was read as
|
|
65
|
+
* @param report - the import report
|
|
66
|
+
*/
|
|
67
|
+
export function reportWeightPrecision(text, value, report) {
|
|
68
|
+
if (!Number.isSafeInteger(value) &&
|
|
69
|
+
Number.isFinite(value) &&
|
|
70
|
+
/^[+-]?\d+$/.test(text) &&
|
|
71
|
+
BigInt(text) !== BigInt(value)) {
|
|
72
|
+
report.warnOnce("precision", PRECISION_CODE, `edge weights: integers beyond 2^53 are stored as the nearest double (first: ${text})`, undefined, `${PRECISION_CODE}:edge weight`);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
49
75
|
/**
|
|
50
76
|
* The weight argument of addEdge from a typed value (JSON, a record field): undefined for null /
|
|
51
77
|
* undefined, the number for a finite or infinite number, the parsed number for numeric text.
|
|
52
78
|
* @param value - the field value
|
|
53
79
|
* @returns the weight, or undefined when absent; E_INVALID_WEIGHT for NaN, a boolean, an object or non-numeric text
|
|
80
|
+
* @category Plugin helpers
|
|
54
81
|
*/
|
|
55
82
|
export function weightFromValue(value) {
|
|
56
83
|
if (value === undefined || value === null) {
|
|
@@ -113,6 +140,7 @@ function weightFormatter(dtype) {
|
|
|
113
140
|
* Build the explicit-weight view of a snapshot.
|
|
114
141
|
* @param snapshot - the snapshot
|
|
115
142
|
* @returns the view
|
|
143
|
+
* @category Writing a format
|
|
116
144
|
*/
|
|
117
145
|
export function explicitWeights(snapshot) {
|
|
118
146
|
const shadowColumn = snapshot.edges.byRole("weight");
|
|
@@ -161,4 +189,35 @@ export function explicitWeights(snapshot) {
|
|
|
161
189
|
},
|
|
162
190
|
};
|
|
163
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* The weight of every edge, in edge order (`weights[e]` is edge `e`'s weight), exactly as the file
|
|
194
|
+
* wrote it, or null for a graph without weights. `snapshot.edgeList().weights` holds the same
|
|
195
|
+
* weights as 32-bit floats, in which 0.1 reads back as 0.10000000149011612; this reads the exact
|
|
196
|
+
* values the import also kept. An edge without a weight of its own has the weight 1.
|
|
197
|
+
* @example
|
|
198
|
+
* ```ts
|
|
199
|
+
* const { snapshot } = await importGraph("source,target,weight\na,b,0.1\n", { format: "csv" });
|
|
200
|
+
* edgeWeights(snapshot); // Float64Array [ 0.1 ]
|
|
201
|
+
* ```
|
|
202
|
+
* @param snapshot - the graph
|
|
203
|
+
* @returns one weight per edge, or null when the graph has no weights
|
|
204
|
+
* @category Loading
|
|
205
|
+
*/
|
|
206
|
+
export function edgeWeights(snapshot) {
|
|
207
|
+
const { weights } = snapshot.edgeList();
|
|
208
|
+
if (weights === null) {
|
|
209
|
+
return null;
|
|
210
|
+
}
|
|
211
|
+
const out = Float64Array.from(weights);
|
|
212
|
+
const exact = snapshot.edges.byRole("weight");
|
|
213
|
+
if (exact !== null) {
|
|
214
|
+
for (let e = 0; e < out.length; e++) {
|
|
215
|
+
const v = exact.value(e);
|
|
216
|
+
if (typeof v === "number") {
|
|
217
|
+
out[e] = v;
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
return out;
|
|
222
|
+
}
|
|
164
223
|
//# sourceMappingURL=weights.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"weights.js","sourceRoot":"","sources":["../../../src/common/weights.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAe,gBAAgB,EAAsB,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"weights.js","sourceRoot":"","sources":["../../../src/common/weights.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EAAe,gBAAgB,EAAsB,MAAM,uBAAuB,CAAC;AAE1F,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AACvD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAGlE;;;GAGG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC;AAEhC;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,IAAY,EAAE,UAAyB;IACjE,OAAO,UAAU,KAAK,IAAI,IAAI,IAAI,KAAK,UAAU,CAAC;AACtD,CAAC;AAED;;;;;;;;GAQG;AACH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AAM,UAAU,WAAW,CAAC,QAAuB;IAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,QAAQ,CAAC,QAAQ,EAAE,CAAC;IACxC,IAAI,OAAO,KAAK,IAAI,EAAE,CAAC;QACnB,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,MAAM,GAAG,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;IAC9C,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACjB,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YAClC,MAAM,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACzB,IAAI,OAAO,CAAC,KAAK,QAAQ,EAAE,CAAC;gBACxB,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;YACf,CAAC;QACL,CAAC;IACL,CAAC;IACD,OAAO,GAAG,CAAC;AACf,CAAC"}
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* Text parts an exporter produces.
|
|
10
|
-
* Consumed by the per-format importers and exporters under src/formats.
|
|
11
10
|
* @public
|
|
11
|
+
* @category Plugin helpers
|
|
12
12
|
*/
|
|
13
13
|
export type TextParts = Iterable<string> | AsyncIterable<string>;
|
|
14
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* The target size of one encoded chunk; parts are coalesced up to it and never split.
|
|
16
|
+
* @category Plugin helpers
|
|
17
|
+
*/
|
|
15
18
|
export declare const DEFAULT_CHUNK_BYTES: number;
|
|
16
19
|
/**
|
|
17
20
|
* Encode text parts as UTF-8 chunks of about `chunkBytes` each. Small parts are coalesced; a part
|
|
@@ -21,31 +24,44 @@ export declare const DEFAULT_CHUNK_BYTES: number;
|
|
|
21
24
|
* @param chunkBytes - the target chunk size in bytes
|
|
22
25
|
* @yields UTF-8 chunks
|
|
23
26
|
* @returns nothing
|
|
27
|
+
* @category Writing a format
|
|
24
28
|
*/
|
|
25
29
|
export declare function encodeChunks(parts: TextParts, chunkBytes?: number): AsyncGenerator<Uint8Array, void, undefined>;
|
|
26
30
|
/**
|
|
27
31
|
* Join text parts into one string.
|
|
28
32
|
* @param parts - the text parts
|
|
29
33
|
* @returns the whole document
|
|
34
|
+
* @category Writing a format
|
|
30
35
|
*/
|
|
31
36
|
export declare function joinText(parts: TextParts): Promise<string>;
|
|
32
37
|
/**
|
|
33
38
|
* Decode UTF-8 chunks back into one string (for tests and for callers holding an export() result).
|
|
34
39
|
* @param chunks - the chunks
|
|
35
40
|
* @returns the decoded text
|
|
41
|
+
* @category Plugin helpers
|
|
36
42
|
*/
|
|
37
43
|
export declare function decodeChunks(chunks: AsyncIterable<Uint8Array>): Promise<string>;
|
|
38
44
|
/**
|
|
39
45
|
* Collect UTF-8 chunks into one Uint8Array.
|
|
40
46
|
* @param chunks - the chunks
|
|
41
47
|
* @returns the concatenated bytes
|
|
48
|
+
* @category Plugin helpers
|
|
42
49
|
*/
|
|
43
50
|
export declare function collectBytes(chunks: AsyncIterable<Uint8Array>): Promise<Uint8Array>;
|
|
44
51
|
/**
|
|
45
52
|
* Wrap an async iterable of chunks as a ReadableStream, pulling one chunk per read and cancelling
|
|
46
|
-
* the iterable when the stream is
|
|
53
|
+
* the iterable when the stream is canceled.
|
|
47
54
|
* @param chunks - the chunks
|
|
48
55
|
* @returns a byte stream
|
|
56
|
+
* @category Saving
|
|
49
57
|
*/
|
|
50
58
|
export declare function toReadableStream(chunks: AsyncIterable<Uint8Array>): ReadableStream<Uint8Array>;
|
|
59
|
+
/**
|
|
60
|
+
* The indentation of one nesting level from an `indent` option: a number of spaces (0 to 16), or
|
|
61
|
+
* the text itself (spaces or tabs). The JSON and DOT exporters take the same option this way.
|
|
62
|
+
* @param value - the option value
|
|
63
|
+
* @param fallback - the indentation when the option is not given
|
|
64
|
+
* @returns the text of one level; "" for none
|
|
65
|
+
*/
|
|
66
|
+
export declare function indentUnit(value: unknown, fallback: string): string;
|
|
51
67
|
//# sourceMappingURL=writer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/common/writer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"writer.d.ts","sourceRoot":"","sources":["../../../src/common/writer.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH;;;;GAIG;AACH,MAAM,MAAM,SAAS,GAAG,QAAQ,CAAC,MAAM,CAAC,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC;AAEjE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,QAAY,CAAC;AAE7C;;;;;;;;;GASG;AACH,wBAAuB,YAAY,CAC/B,KAAK,EAAE,SAAS,EAChB,UAAU,GAAE,MAA4B,GACzC,cAAc,CAAC,UAAU,EAAE,IAAI,EAAE,SAAS,CAAC,CAoB7C;AAED;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,KAAK,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,CAAC,CAMhE;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,CAQrF;AAED;;;;;GAKG;AACH,wBAAsB,YAAY,CAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAczF;AAED;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,cAAc,CAAC,UAAU,CAAC,CAe9F;AAED;;;;;;GAMG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,GAAG,MAAM,CAenE"}
|