@graphty/graph-io 0.3.48 → 0.3.50
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/dist/chunks/{approximations-C2riR4NT.js → approximations-BRXsll0T.js} +2 -2
- package/dist/chunks/{approximations-C2riR4NT.js.map → approximations-BRXsll0T.js.map} +1 -1
- package/dist/chunks/bends-BGXjv_U4.js +129 -0
- package/dist/chunks/bends-BGXjv_U4.js.map +1 -0
- package/dist/chunks/{block-Cu22ewuS.js → block-yl0f_qLO.js} +931 -164
- package/dist/chunks/block-yl0f_qLO.js.map +1 -0
- package/dist/chunks/choose-CczZJaX_.js +717 -0
- package/dist/chunks/choose-CczZJaX_.js.map +1 -0
- package/dist/chunks/{codes-CV_Bhcyi.js → codes-BE2xir2k.js} +6 -2
- package/dist/chunks/codes-BE2xir2k.js.map +1 -0
- package/dist/chunks/{constants-D0LqcsLJ.js → constants-CKkYLPtt.js} +2 -2
- package/dist/chunks/{constants-D0LqcsLJ.js.map → constants-CKkYLPtt.js.map} +1 -1
- package/dist/chunks/{context-cgmmOxZ2.js → context-DizmppHy.js} +5 -4
- package/dist/chunks/{context-cgmmOxZ2.js.map → context-DizmppHy.js.map} +1 -1
- package/dist/chunks/{convert-BcQ8_jMo.js → convert-Ct2zelbQ.js} +7 -2
- package/dist/chunks/convert-Ct2zelbQ.js.map +1 -0
- package/dist/chunks/{credentials-BiQsnMTb.js → credentials-CmvJXYeH.js} +67 -16
- package/dist/chunks/credentials-CmvJXYeH.js.map +1 -0
- package/dist/chunks/{cx-export-BEeF6ymo.js → cx-export-Bt6NoqTQ.js} +3 -3
- package/dist/chunks/{cx-export-BEeF6ymo.js.map → cx-export-Bt6NoqTQ.js.map} +1 -1
- package/dist/chunks/descriptor-B28U25x4.js +60 -0
- package/dist/chunks/descriptor-B28U25x4.js.map +1 -0
- package/dist/chunks/{descriptor-BJ-W0Jd-.js → descriptor-Dhez_Cew.js} +11 -2
- package/dist/chunks/descriptor-Dhez_Cew.js.map +1 -0
- package/dist/chunks/{emit-CD8xnY8s.js → emit-7Jkpg0yd.js} +1788 -133
- package/dist/chunks/emit-7Jkpg0yd.js.map +1 -0
- package/dist/chunks/{escape-DH2Egt-l.js → escape-CuCIzNMB.js} +8 -8
- package/dist/chunks/{escape-DH2Egt-l.js.map → escape-CuCIzNMB.js.map} +1 -1
- package/dist/chunks/{export-CZ7VRm4I.js → export-Cha4dRFz.js} +45 -387
- package/dist/chunks/export-Cha4dRFz.js.map +1 -0
- package/dist/chunks/{exporter-ChjL5fmP.js → exporter-1Ajud15J.js} +9 -8
- package/dist/chunks/{exporter-ChjL5fmP.js.map → exporter-1Ajud15J.js.map} +1 -1
- package/dist/chunks/{exporter-BIdaoIgh.js → exporter-B6yvL3wy.js} +7 -7
- package/dist/chunks/{exporter-BIdaoIgh.js.map → exporter-B6yvL3wy.js.map} +1 -1
- package/dist/chunks/{exporter-Dcw7Ldtq.js → exporter-BP6otMO6.js} +6 -6
- package/dist/chunks/{exporter-Dcw7Ldtq.js.map → exporter-BP6otMO6.js.map} +1 -1
- package/dist/chunks/{exporter-DtVU80Fa.js → exporter-CA5q8ROP.js} +9 -8
- package/dist/chunks/{exporter-DtVU80Fa.js.map → exporter-CA5q8ROP.js.map} +1 -1
- package/dist/chunks/{exporter-bxxjOrDZ.js → exporter-CQQZFJ2v.js} +1284 -156
- package/dist/chunks/exporter-CQQZFJ2v.js.map +1 -0
- package/dist/chunks/format-BXiAb-1h.js +408 -0
- package/dist/chunks/format-BXiAb-1h.js.map +1 -0
- package/dist/chunks/{generic-CP6YD34u.js → generic-Dc21MAdg.js} +387 -31
- package/dist/chunks/generic-Dc21MAdg.js.map +1 -0
- package/dist/chunks/{importer-B87_fmVx.js → importer-C6NVpCXp.js} +327 -84
- package/dist/chunks/importer-C6NVpCXp.js.map +1 -0
- package/dist/chunks/{importer-DPZDN40-.js → importer-CKFe4q54.js} +25 -17
- package/dist/chunks/importer-CKFe4q54.js.map +1 -0
- package/dist/chunks/{importer-Bji2MeWr.js → importer-CKbUbsJA.js} +13 -10
- package/dist/chunks/{importer-Bji2MeWr.js.map → importer-CKbUbsJA.js.map} +1 -1
- package/dist/chunks/{importer-CB_zV5_L.js → importer-ClCsdgTJ.js} +208 -1104
- package/dist/chunks/importer-ClCsdgTJ.js.map +1 -0
- package/dist/chunks/{importer-e3huMZbm.js → importer-CyVZTrf0.js} +14 -10
- package/dist/chunks/importer-CyVZTrf0.js.map +1 -0
- package/dist/chunks/{importer-CVT-JyDE.js → importer-DgG4v1Ms.js} +1537 -355
- package/dist/chunks/importer-DgG4v1Ms.js.map +1 -0
- package/dist/chunks/{importer-Cyy6UseH.js → importer-asFUrIsj.js} +66 -13
- package/dist/chunks/importer-asFUrIsj.js.map +1 -0
- package/dist/chunks/{input-Ccg9I22A.js → input-CAxt_aV-.js} +4 -4
- package/dist/chunks/{input-Ccg9I22A.js.map → input-CAxt_aV-.js.map} +1 -1
- package/dist/chunks/{json-elements-By172SVq.js → json-elements-Cq76WjnZ.js} +4 -4
- package/dist/chunks/{json-elements-By172SVq.js.map → json-elements-Cq76WjnZ.js.map} +1 -1
- package/dist/chunks/{lexicon-u2SI5xcx.js → lexicon-IVRq2Uoo.js} +282 -74
- package/dist/chunks/lexicon-IVRq2Uoo.js.map +1 -0
- package/dist/chunks/{ontology-export-BwgMyuF0.js → ontology-export-OMo91mb0.js} +4 -4
- package/dist/chunks/{ontology-export-BwgMyuF0.js.map → ontology-export-OMo91mb0.js.map} +1 -1
- package/dist/chunks/{records-Cgvxz-Vx.js → records-NJiYvekn.js} +2 -2
- package/dist/chunks/{records-Cgvxz-Vx.js.map → records-NJiYvekn.js.map} +1 -1
- package/dist/chunks/{report-CgdsL9Hb.js → report-CwMfYa9J.js} +23 -23
- package/dist/chunks/{report-CgdsL9Hb.js.map → report-CwMfYa9J.js.map} +1 -1
- package/dist/chunks/round-trip-Cy3_SHRZ.js +79 -0
- package/dist/chunks/round-trip-Cy3_SHRZ.js.map +1 -0
- package/dist/chunks/{sigv4-LkAzsLAu.js → sigv4-BXwVbza3.js} +5 -5
- package/dist/chunks/sigv4-BXwVbza3.js.map +1 -0
- package/dist/chunks/{styles-CaABMoO1.js → styles-CAVmBLgp.js} +1237 -138
- package/dist/chunks/styles-CAVmBLgp.js.map +1 -0
- package/dist/chunks/styles-CPczw1Jz.js +1928 -0
- package/dist/chunks/styles-CPczw1Jz.js.map +1 -0
- package/dist/chunks/styles-boK6Ln54.js +2847 -0
- package/dist/chunks/styles-boK6Ln54.js.map +1 -0
- package/dist/chunks/{styles-yed-Cs1nmrjn.js → styles-yed-XeFBQ6VS.js} +506 -175
- package/dist/chunks/styles-yed-XeFBQ6VS.js.map +1 -0
- package/dist/chunks/{text-BuKQVMz2.js → text-ystE2bYi.js} +2 -2
- package/dist/chunks/{text-BuKQVMz2.js.map → text-ystE2bYi.js.map} +1 -1
- package/dist/csv.js +7 -7
- package/dist/cx.js +2 -2
- package/dist/cx2.js +2 -2
- package/dist/cys.js +1 -1
- package/dist/dot.js +8 -4
- package/dist/dot.js.map +1 -1
- package/dist/gexf.js +42 -12
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +848 -194
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +230 -193
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +3 -3
- package/dist/json.js +3 -2
- package/dist/neo4j.js +6 -6
- package/dist/obo.js +1 -1
- package/dist/pajek.js +1 -1
- package/dist/positions.js +45 -3
- package/dist/positions.js.map +1 -1
- package/dist/sources-cypher.js +141 -23
- package/dist/sources-cypher.js.map +1 -1
- package/dist/sources-ndex.js +2 -2
- package/dist/sources-rest.js +32 -6
- package/dist/sources-rest.js.map +1 -1
- package/dist/sources-sparql.d.ts +1 -0
- package/dist/sources-sparql.js +439 -0
- package/dist/sources-sparql.js.map +1 -0
- package/dist/src/formats/cx/importer.d.ts.map +1 -1
- package/dist/src/formats/cx/importer.js +5 -1
- package/dist/src/formats/cx/importer.js.map +1 -1
- package/dist/src/formats/cx/styles.d.ts +24 -1
- package/dist/src/formats/cx/styles.d.ts.map +1 -1
- package/dist/src/formats/cx/styles.js +117 -11
- package/dist/src/formats/cx/styles.js.map +1 -1
- package/dist/src/formats/cx2/importer.d.ts.map +1 -1
- package/dist/src/formats/cx2/importer.js +1 -0
- package/dist/src/formats/cx2/importer.js.map +1 -1
- package/dist/src/formats/cx2/styles.d.ts.map +1 -1
- package/dist/src/formats/cx2/styles.js +3 -1
- package/dist/src/formats/cx2/styles.js.map +1 -1
- package/dist/src/formats/cys/importer.d.ts.map +1 -1
- package/dist/src/formats/cys/importer.js +1 -0
- package/dist/src/formats/cys/importer.js.map +1 -1
- package/dist/src/formats/cys/styles.d.ts +2 -0
- package/dist/src/formats/cys/styles.d.ts.map +1 -1
- package/dist/src/formats/cys/styles.js +15 -7
- package/dist/src/formats/cys/styles.js.map +1 -1
- package/dist/src/formats/dot/drawing.d.ts +98 -0
- package/dist/src/formats/dot/drawing.d.ts.map +1 -0
- package/dist/src/formats/dot/drawing.js +734 -0
- package/dist/src/formats/dot/drawing.js.map +1 -0
- package/dist/src/formats/dot/exporter.d.ts.map +1 -1
- package/dist/src/formats/dot/exporter.js +34 -2
- package/dist/src/formats/dot/exporter.js.map +1 -1
- package/dist/src/formats/dot/importer.d.ts +6 -1
- package/dist/src/formats/dot/importer.d.ts.map +1 -1
- package/dist/src/formats/dot/importer.js +170 -33
- package/dist/src/formats/dot/importer.js.map +1 -1
- package/dist/src/formats/dot/index.d.ts +3 -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/label-places.d.ts +41 -0
- package/dist/src/formats/dot/label-places.d.ts.map +1 -0
- package/dist/src/formats/dot/label-places.js +185 -0
- package/dist/src/formats/dot/label-places.js.map +1 -0
- package/dist/src/formats/dot/names.d.ts +13 -0
- package/dist/src/formats/dot/names.d.ts.map +1 -1
- package/dist/src/formats/dot/names.js +13 -0
- package/dist/src/formats/dot/names.js.map +1 -1
- package/dist/src/formats/dot/record.d.ts +50 -0
- package/dist/src/formats/dot/record.d.ts.map +1 -0
- package/dist/src/formats/dot/record.js +275 -0
- package/dist/src/formats/dot/record.js.map +1 -0
- package/dist/src/formats/dot/styles.d.ts +72 -2
- package/dist/src/formats/dot/styles.d.ts.map +1 -1
- package/dist/src/formats/dot/styles.js +1500 -119
- package/dist/src/formats/dot/styles.js.map +1 -1
- package/dist/src/formats/gexf/dialog-metrics.d.ts +15 -0
- package/dist/src/formats/gexf/dialog-metrics.d.ts.map +1 -0
- package/dist/src/formats/gexf/dialog-metrics.js +59 -0
- package/dist/src/formats/gexf/dialog-metrics.js.map +1 -0
- package/dist/src/formats/gexf/importer.d.ts +7 -0
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +41 -5
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gexf/preview.d.ts +77 -0
- package/dist/src/formats/gexf/preview.d.ts.map +1 -0
- package/dist/src/formats/gexf/preview.js +191 -0
- package/dist/src/formats/gexf/preview.js.map +1 -0
- package/dist/src/formats/gexf/schema.d.ts.map +1 -1
- package/dist/src/formats/gexf/schema.js +2 -1
- package/dist/src/formats/gexf/schema.js.map +1 -1
- package/dist/src/formats/gexf/styles.d.ts +58 -31
- package/dist/src/formats/gexf/styles.d.ts.map +1 -1
- package/dist/src/formats/gexf/styles.js +848 -225
- package/dist/src/formats/gexf/styles.js.map +1 -1
- package/dist/src/formats/gml/importer.d.ts +5 -2
- package/dist/src/formats/gml/importer.d.ts.map +1 -1
- package/dist/src/formats/gml/importer.js +258 -71
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/index.d.ts +1 -1
- package/dist/src/formats/gml/index.d.ts.map +1 -1
- package/dist/src/formats/gml/index.js +1 -1
- package/dist/src/formats/gml/index.js.map +1 -1
- package/dist/src/formats/gml/positions.d.ts +7 -0
- package/dist/src/formats/gml/positions.d.ts.map +1 -1
- package/dist/src/formats/gml/positions.js +29 -7
- package/dist/src/formats/gml/positions.js.map +1 -1
- package/dist/src/formats/gml/styles.d.ts.map +1 -1
- package/dist/src/formats/gml/styles.js +754 -102
- package/dist/src/formats/gml/styles.js.map +1 -1
- package/dist/src/formats/graphml/styles-plain.d.ts.map +1 -1
- package/dist/src/formats/graphml/styles-plain.js +6 -10
- package/dist/src/formats/graphml/styles-plain.js.map +1 -1
- package/dist/src/formats/graphml/styles-yed.d.ts +21 -15
- package/dist/src/formats/graphml/styles-yed.d.ts.map +1 -1
- package/dist/src/formats/graphml/styles-yed.js +695 -164
- package/dist/src/formats/graphml/styles-yed.js.map +1 -1
- package/dist/src/formats/graphml/styles-yfiles3.d.ts +1 -1
- package/dist/src/formats/graphml/styles-yfiles3.d.ts.map +1 -1
- package/dist/src/formats/graphml/styles-yfiles3.js +431 -64
- package/dist/src/formats/graphml/styles-yfiles3.js.map +1 -1
- package/dist/src/formats/graphml/yfiles.d.ts +3 -3
- package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
- package/dist/src/formats/graphml/yfiles.js +16 -6
- package/dist/src/formats/graphml/yfiles.js.map +1 -1
- package/dist/src/formats/json/dialect.d.ts +3 -2
- package/dist/src/formats/json/dialect.d.ts.map +1 -1
- package/dist/src/formats/json/dialect.js +39 -5
- package/dist/src/formats/json/dialect.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts +13 -2
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +42 -6
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/index.d.ts +1 -1
- package/dist/src/formats/json/index.d.ts.map +1 -1
- package/dist/src/formats/json/index.js +1 -1
- package/dist/src/formats/json/index.js.map +1 -1
- package/dist/src/formats/json/positions.d.ts +5 -2
- package/dist/src/formats/json/positions.d.ts.map +1 -1
- package/dist/src/formats/json/positions.js +20 -4
- package/dist/src/formats/json/positions.js.map +1 -1
- package/dist/src/formats/json/styles.d.ts +12 -1
- package/dist/src/formats/json/styles.d.ts.map +1 -1
- package/dist/src/formats/json/styles.js +1843 -136
- package/dist/src/formats/json/styles.js.map +1 -1
- package/dist/src/formats/pajek/draw.d.ts +104 -0
- package/dist/src/formats/pajek/draw.d.ts.map +1 -0
- package/dist/src/formats/pajek/draw.js +382 -0
- package/dist/src/formats/pajek/draw.js.map +1 -0
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +70 -51
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.d.ts +9 -0
- package/dist/src/formats/pajek/importer.d.ts.map +1 -1
- package/dist/src/formats/pajek/importer.js +233 -102
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/index.d.ts +1 -0
- package/dist/src/formats/pajek/index.d.ts.map +1 -1
- package/dist/src/formats/pajek/index.js.map +1 -1
- package/dist/src/formats/pajek/styles.d.ts +15 -7
- package/dist/src/formats/pajek/styles.d.ts.map +1 -1
- package/dist/src/formats/pajek/styles.js +1395 -114
- package/dist/src/formats/pajek/styles.js.map +1 -1
- package/dist/src/formats/pajek/syntax.d.ts +10 -1
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +26 -2
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/emit.d.ts +1 -0
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
- package/dist/src/formats/xgmml/emit.js +65 -5
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/styles.d.ts +23 -3
- package/dist/src/formats/xgmml/styles.d.ts.map +1 -1
- package/dist/src/formats/xgmml/styles.js +277 -60
- package/dist/src/formats/xgmml/styles.js.map +1 -1
- package/dist/src/index.d.ts +6 -5
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +6 -5
- package/dist/src/index.js.map +1 -1
- package/dist/src/positions/convert.d.ts.map +1 -1
- package/dist/src/positions/convert.js +11 -1
- package/dist/src/positions/convert.js.map +1 -1
- package/dist/src/positions/extract.d.ts.map +1 -1
- package/dist/src/positions/extract.js +53 -1
- package/dist/src/positions/extract.js.map +1 -1
- package/dist/src/positions/index.d.ts +1 -1
- package/dist/src/positions/index.d.ts.map +1 -1
- package/dist/src/positions/types.d.ts +59 -0
- package/dist/src/positions/types.d.ts.map +1 -1
- package/dist/src/sources/builtins.d.ts +1 -1
- package/dist/src/sources/builtins.d.ts.map +1 -1
- package/dist/src/sources/builtins.js +8 -2
- package/dist/src/sources/builtins.js.map +1 -1
- package/dist/src/sources/context.d.ts.map +1 -1
- package/dist/src/sources/context.js +1 -0
- package/dist/src/sources/context.js.map +1 -1
- package/dist/src/sources/credentials.d.ts +50 -1
- package/dist/src/sources/credentials.d.ts.map +1 -1
- package/dist/src/sources/credentials.js +69 -0
- package/dist/src/sources/credentials.js.map +1 -1
- package/dist/src/sources/cypher/descriptor.d.ts.map +1 -1
- package/dist/src/sources/cypher/descriptor.js +5 -0
- package/dist/src/sources/cypher/descriptor.js.map +1 -1
- package/dist/src/sources/cypher/index.d.ts.map +1 -1
- package/dist/src/sources/cypher/index.js +125 -18
- package/dist/src/sources/cypher/index.js.map +1 -1
- package/dist/src/sources/cypher/params.d.ts +1 -1
- package/dist/src/sources/cypher/params.d.ts.map +1 -1
- package/dist/src/sources/cypher/query-builder.d.ts +17 -0
- package/dist/src/sources/cypher/query-builder.d.ts.map +1 -1
- package/dist/src/sources/cypher/query-builder.js +31 -0
- package/dist/src/sources/cypher/query-builder.js.map +1 -1
- package/dist/src/sources/ids.d.ts +5 -0
- package/dist/src/sources/ids.d.ts.map +1 -1
- package/dist/src/sources/ids.js +5 -0
- package/dist/src/sources/ids.js.map +1 -1
- package/dist/src/sources/params.d.ts +3 -0
- package/dist/src/sources/params.d.ts.map +1 -1
- package/dist/src/sources/rest/descriptor.d.ts.map +1 -1
- package/dist/src/sources/rest/descriptor.js +9 -0
- package/dist/src/sources/rest/descriptor.js.map +1 -1
- package/dist/src/sources/rest/openalex.d.ts +4 -2
- package/dist/src/sources/rest/openalex.d.ts.map +1 -1
- package/dist/src/sources/rest/openalex.js +4 -2
- package/dist/src/sources/rest/openalex.js.map +1 -1
- package/dist/src/sources/rest/source.d.ts.map +1 -1
- package/dist/src/sources/rest/source.js +38 -0
- package/dist/src/sources/rest/source.js.map +1 -1
- package/dist/src/sources/run.d.ts +2 -0
- package/dist/src/sources/run.d.ts.map +1 -1
- package/dist/src/sources/run.js +30 -3
- package/dist/src/sources/run.js.map +1 -1
- package/dist/src/sources/sigv4.d.ts +5 -3
- package/dist/src/sources/sigv4.d.ts.map +1 -1
- package/dist/src/sources/sigv4.js +6 -4
- package/dist/src/sources/sigv4.js.map +1 -1
- package/dist/src/sources/sparql/descriptor.d.ts +10 -0
- package/dist/src/sources/sparql/descriptor.d.ts.map +1 -0
- package/dist/src/sources/sparql/descriptor.js +64 -0
- package/dist/src/sources/sparql/descriptor.js.map +1 -0
- package/dist/src/sources/sparql/index.d.ts +28 -0
- package/dist/src/sources/sparql/index.d.ts.map +1 -0
- package/dist/src/sources/sparql/index.js +327 -0
- package/dist/src/sources/sparql/index.js.map +1 -0
- package/dist/src/sources/sparql/ntriples.d.ts +69 -0
- package/dist/src/sources/sparql/ntriples.d.ts.map +1 -0
- package/dist/src/sources/sparql/ntriples.js +180 -0
- package/dist/src/sources/sparql/ntriples.js.map +1 -0
- package/dist/src/sources/sparql/params.d.ts +27 -0
- package/dist/src/sources/sparql/params.d.ts.map +1 -0
- package/dist/src/sources/sparql/params.js +5 -0
- package/dist/src/sources/sparql/params.js.map +1 -0
- package/dist/src/sources/sparql/query.d.ts +73 -0
- package/dist/src/sources/sparql/query.d.ts.map +1 -0
- package/dist/src/sources/sparql/query.js +164 -0
- package/dist/src/sources/sparql/query.js.map +1 -0
- package/dist/src/sources/types.d.ts +60 -0
- package/dist/src/sources/types.d.ts.map +1 -1
- package/dist/src/styles/annotations.d.ts +61 -5
- package/dist/src/styles/annotations.d.ts.map +1 -1
- package/dist/src/styles/annotations.js +130 -22
- package/dist/src/styles/annotations.js.map +1 -1
- package/dist/src/styles/canon/bends.d.ts +46 -0
- package/dist/src/styles/canon/bends.d.ts.map +1 -1
- package/dist/src/styles/canon/bends.js +123 -0
- package/dist/src/styles/canon/bends.js.map +1 -1
- package/dist/src/styles/canon/color-tables.d.ts +6 -1
- package/dist/src/styles/canon/color-tables.d.ts.map +1 -1
- package/dist/src/styles/canon/color-tables.js +10 -4
- package/dist/src/styles/canon/color-tables.js.map +1 -1
- package/dist/src/styles/canon/color.d.ts +3 -1
- package/dist/src/styles/canon/color.d.ts.map +1 -1
- package/dist/src/styles/canon/color.js +103 -3
- package/dist/src/styles/canon/color.js.map +1 -1
- package/dist/src/styles/canon/enums.d.ts +2 -2
- package/dist/src/styles/canon/enums.d.ts.map +1 -1
- package/dist/src/styles/canon/enums.js +89 -7
- package/dist/src/styles/canon/enums.js.map +1 -1
- package/dist/src/styles/canon/graphviz.d.ts +12 -3
- package/dist/src/styles/canon/graphviz.d.ts.map +1 -1
- package/dist/src/styles/canon/graphviz.js +57 -9
- package/dist/src/styles/canon/graphviz.js.map +1 -1
- package/dist/src/styles/canon/number.d.ts +8 -0
- package/dist/src/styles/canon/number.d.ts.map +1 -1
- package/dist/src/styles/canon/number.js +18 -0
- package/dist/src/styles/canon/number.js.map +1 -1
- package/dist/src/styles/canon/text.d.ts +29 -2
- package/dist/src/styles/canon/text.d.ts.map +1 -1
- package/dist/src/styles/canon/text.js +156 -16
- package/dist/src/styles/canon/text.js.map +1 -1
- package/dist/src/styles/codes.d.ts +2 -0
- package/dist/src/styles/codes.d.ts.map +1 -1
- package/dist/src/styles/codes.js +2 -0
- package/dist/src/styles/codes.js.map +1 -1
- package/dist/src/styles/cyjs/cascade.d.ts.map +1 -1
- package/dist/src/styles/cyjs/cascade.js +1139 -79
- package/dist/src/styles/cyjs/cascade.js.map +1 -1
- package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -1
- package/dist/src/styles/cyjs/defaults-table.js +4 -0
- package/dist/src/styles/cyjs/defaults-table.js.map +1 -1
- package/dist/src/styles/cyjs/emit.d.ts.map +1 -1
- package/dist/src/styles/cyjs/emit.js +232 -10
- package/dist/src/styles/cyjs/emit.js.map +1 -1
- package/dist/src/styles/cyjs/face.d.ts +20 -0
- package/dist/src/styles/cyjs/face.d.ts.map +1 -0
- package/dist/src/styles/cyjs/face.js +332 -0
- package/dist/src/styles/cyjs/face.js.map +1 -0
- package/dist/src/styles/cyjs/mappers.d.ts +44 -1
- package/dist/src/styles/cyjs/mappers.d.ts.map +1 -1
- package/dist/src/styles/cyjs/mappers.js +475 -26
- package/dist/src/styles/cyjs/mappers.js.map +1 -1
- package/dist/src/styles/cyjs/routes.d.ts +53 -0
- package/dist/src/styles/cyjs/routes.d.ts.map +1 -0
- package/dist/src/styles/cyjs/routes.js +360 -0
- package/dist/src/styles/cyjs/routes.js.map +1 -0
- package/dist/src/styles/cytoscape/charts.d.ts +23 -0
- package/dist/src/styles/cytoscape/charts.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/charts.js +560 -0
- package/dist/src/styles/cytoscape/charts.js.map +1 -0
- package/dist/src/styles/cytoscape/emit.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/emit.js +156 -48
- package/dist/src/styles/cytoscape/emit.js.map +1 -1
- package/dist/src/styles/cytoscape/lexicon.d.ts +91 -3
- package/dist/src/styles/cytoscape/lexicon.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/lexicon.js +387 -77
- package/dist/src/styles/cytoscape/lexicon.js.map +1 -1
- package/dist/src/styles/cytoscape/mappings.d.ts +30 -0
- package/dist/src/styles/cytoscape/mappings.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/mappings.js +92 -0
- package/dist/src/styles/cytoscape/mappings.js.map +1 -1
- package/dist/src/styles/cytoscape/resolve.d.ts +42 -2
- package/dist/src/styles/cytoscape/resolve.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/resolve.js +623 -17
- package/dist/src/styles/cytoscape/resolve.js.map +1 -1
- package/dist/src/styles/defaults.d.ts +46 -26
- package/dist/src/styles/defaults.d.ts.map +1 -1
- package/dist/src/styles/defaults.js +308 -71
- package/dist/src/styles/defaults.js.map +1 -1
- package/dist/src/styles/index.d.ts +4 -3
- package/dist/src/styles/index.d.ts.map +1 -1
- package/dist/src/styles/index.js +3 -2
- package/dist/src/styles/index.js.map +1 -1
- package/dist/src/styles/internal.d.ts +1 -0
- package/dist/src/styles/internal.d.ts.map +1 -1
- package/dist/src/styles/internal.js +1 -0
- package/dist/src/styles/internal.js.map +1 -1
- package/dist/src/styles/io/generic.d.ts.map +1 -1
- package/dist/src/styles/io/generic.js +56 -16
- package/dist/src/styles/io/generic.js.map +1 -1
- package/dist/src/styles/io/round-trip.d.ts +56 -0
- package/dist/src/styles/io/round-trip.d.ts.map +1 -0
- package/dist/src/styles/io/round-trip.js +138 -0
- package/dist/src/styles/io/round-trip.js.map +1 -0
- package/dist/src/styles/io/writer.d.ts.map +1 -1
- package/dist/src/styles/io/writer.js +6 -1
- package/dist/src/styles/io/writer.js.map +1 -1
- package/dist/src/styles/notes.d.ts.map +1 -1
- package/dist/src/styles/notes.js +1 -0
- package/dist/src/styles/notes.js.map +1 -1
- package/dist/src/styles/plan/features.d.ts +1 -1
- package/dist/src/styles/plan/features.d.ts.map +1 -1
- package/dist/src/styles/plan/features.js +22 -2
- package/dist/src/styles/plan/features.js.map +1 -1
- package/dist/src/styles/plan/index.d.ts +1 -1
- package/dist/src/styles/plan/index.d.ts.map +1 -1
- package/dist/src/styles/plan/index.js +1 -1
- package/dist/src/styles/plan/index.js.map +1 -1
- package/dist/src/styles/plan/plan.d.ts.map +1 -1
- package/dist/src/styles/plan/plan.js +61 -4
- package/dist/src/styles/plan/plan.js.map +1 -1
- package/dist/src/styles/plan/resolve.d.ts +11 -0
- package/dist/src/styles/plan/resolve.d.ts.map +1 -1
- package/dist/src/styles/plan/resolve.js +40 -4
- package/dist/src/styles/plan/resolve.js.map +1 -1
- package/dist/src/styles/slots.d.ts +14 -0
- package/dist/src/styles/slots.d.ts.map +1 -0
- package/dist/src/styles/slots.js +20 -0
- package/dist/src/styles/slots.js.map +1 -0
- package/dist/src/styles/types.d.ts +687 -6
- package/dist/src/styles/types.d.ts.map +1 -1
- package/dist/src/styles/vocabulary.d.ts +3 -2
- package/dist/src/styles/vocabulary.d.ts.map +1 -1
- package/dist/src/styles/vocabulary.js +224 -0
- package/dist/src/styles/vocabulary.js.map +1 -1
- package/dist/styles.js +30 -239
- package/dist/styles.js.map +1 -1
- package/dist/xgmml.js +3 -3
- package/package.json +27 -7
- package/src/formats/cx/importer.ts +6 -1
- package/src/formats/cx/styles.ts +143 -9
- package/src/formats/cx2/importer.ts +1 -0
- package/src/formats/cx2/styles.ts +3 -1
- package/src/formats/cys/importer.ts +1 -0
- package/src/formats/cys/styles.ts +27 -5
- package/src/formats/dot/drawing.ts +799 -0
- package/src/formats/dot/exporter.ts +37 -1
- package/src/formats/dot/importer.ts +192 -36
- package/src/formats/dot/index.ts +3 -1
- package/src/formats/dot/label-places.ts +241 -0
- package/src/formats/dot/names.ts +15 -0
- package/src/formats/dot/record.ts +336 -0
- package/src/formats/dot/styles.ts +1702 -149
- package/src/formats/gexf/dialog-metrics.ts +61 -0
- package/src/formats/gexf/importer.ts +50 -5
- package/src/formats/gexf/preview.ts +217 -0
- package/src/formats/gexf/schema.ts +2 -1
- package/src/formats/gexf/styles.ts +1099 -245
- package/src/formats/gml/importer.ts +291 -76
- package/src/formats/gml/index.ts +1 -1
- package/src/formats/gml/positions.ts +29 -7
- package/src/formats/gml/styles.ts +852 -110
- package/src/formats/graphml/styles-plain.ts +6 -15
- package/src/formats/graphml/styles-yed.ts +765 -176
- package/src/formats/graphml/styles-yfiles3.ts +487 -63
- package/src/formats/graphml/yfiles.ts +19 -6
- package/src/formats/json/dialect.ts +41 -5
- package/src/formats/json/importer.ts +59 -7
- package/src/formats/json/index.ts +1 -0
- package/src/formats/json/positions.ts +22 -5
- package/src/formats/json/styles.ts +2123 -171
- package/src/formats/pajek/draw.ts +469 -0
- package/src/formats/pajek/exporter.ts +81 -49
- package/src/formats/pajek/importer.ts +278 -103
- package/src/formats/pajek/index.ts +1 -0
- package/src/formats/pajek/styles.ts +1506 -133
- package/src/formats/pajek/syntax.ts +27 -2
- package/src/formats/xgmml/emit.ts +73 -5
- package/src/formats/xgmml/styles.ts +330 -71
- package/src/index.ts +12 -1
- package/src/positions/convert.ts +12 -1
- package/src/positions/extract.ts +55 -1
- package/src/positions/index.ts +1 -0
- package/src/positions/types.ts +60 -0
- package/src/sources/builtins.ts +8 -1
- package/src/sources/context.ts +1 -0
- package/src/sources/credentials.ts +90 -1
- package/src/sources/cypher/descriptor.ts +7 -1
- package/src/sources/cypher/index.ts +149 -18
- package/src/sources/cypher/params.ts +1 -1
- package/src/sources/cypher/query-builder.ts +33 -0
- package/src/sources/ids.ts +6 -0
- package/src/sources/params.ts +3 -0
- package/src/sources/rest/descriptor.ts +9 -0
- package/src/sources/rest/openalex.ts +4 -2
- package/src/sources/rest/source.ts +41 -0
- package/src/sources/run.ts +35 -3
- package/src/sources/sigv4.ts +6 -4
- package/src/sources/sparql/descriptor.ts +67 -0
- package/src/sources/sparql/index.ts +371 -0
- package/src/sources/sparql/ntriples.ts +219 -0
- package/src/sources/sparql/params.ts +28 -0
- package/src/sources/sparql/query.ts +216 -0
- package/src/sources/types.ts +68 -0
- package/src/styles/annotations.ts +201 -27
- package/src/styles/canon/bends.ts +137 -0
- package/src/styles/canon/color-tables.ts +10 -4
- package/src/styles/canon/color.ts +105 -3
- package/src/styles/canon/enums.ts +107 -8
- package/src/styles/canon/graphviz.ts +71 -10
- package/src/styles/canon/number.ts +19 -0
- package/src/styles/canon/text.ts +187 -16
- package/src/styles/codes.ts +2 -0
- package/src/styles/cyjs/cascade.ts +1303 -84
- package/src/styles/cyjs/defaults-table.ts +4 -0
- package/src/styles/cyjs/emit.ts +268 -14
- package/src/styles/cyjs/face.ts +372 -0
- package/src/styles/cyjs/mappers.ts +506 -27
- package/src/styles/cyjs/routes.ts +432 -0
- package/src/styles/cytoscape/charts.ts +684 -0
- package/src/styles/cytoscape/emit.ts +170 -48
- package/src/styles/cytoscape/lexicon.ts +431 -78
- package/src/styles/cytoscape/mappings.ts +108 -0
- package/src/styles/cytoscape/resolve.ts +741 -17
- package/src/styles/defaults.ts +417 -108
- package/src/styles/index.ts +5 -0
- package/src/styles/internal.ts +1 -0
- package/src/styles/io/generic.ts +79 -23
- package/src/styles/io/round-trip.ts +202 -0
- package/src/styles/io/writer.ts +6 -1
- package/src/styles/notes.ts +1 -0
- package/src/styles/plan/features.ts +23 -2
- package/src/styles/plan/index.ts +1 -1
- package/src/styles/plan/plan.ts +69 -5
- package/src/styles/plan/resolve.ts +47 -4
- package/src/styles/slots.ts +25 -0
- package/src/styles/types.ts +698 -5
- package/src/styles/vocabulary.ts +232 -2
- package/dist/chunks/block-Cu22ewuS.js.map +0 -1
- package/dist/chunks/choose-Cdx6Enl2.js +0 -57
- package/dist/chunks/choose-Cdx6Enl2.js.map +0 -1
- package/dist/chunks/codes-CV_Bhcyi.js.map +0 -1
- package/dist/chunks/convert-BcQ8_jMo.js.map +0 -1
- package/dist/chunks/credentials-BiQsnMTb.js.map +0 -1
- package/dist/chunks/descriptor-BJ-W0Jd-.js.map +0 -1
- package/dist/chunks/emit-CD8xnY8s.js.map +0 -1
- package/dist/chunks/export-CZ7VRm4I.js.map +0 -1
- package/dist/chunks/exporter-bxxjOrDZ.js.map +0 -1
- package/dist/chunks/format-BMS-1Nxb.js +0 -64
- package/dist/chunks/format-BMS-1Nxb.js.map +0 -1
- package/dist/chunks/generic-CP6YD34u.js.map +0 -1
- package/dist/chunks/importer-B87_fmVx.js.map +0 -1
- package/dist/chunks/importer-CB_zV5_L.js.map +0 -1
- package/dist/chunks/importer-CVT-JyDE.js.map +0 -1
- package/dist/chunks/importer-Cyy6UseH.js.map +0 -1
- package/dist/chunks/importer-DPZDN40-.js.map +0 -1
- package/dist/chunks/importer-e3huMZbm.js.map +0 -1
- package/dist/chunks/lexicon-u2SI5xcx.js.map +0 -1
- package/dist/chunks/sigv4-LkAzsLAu.js.map +0 -1
- package/dist/chunks/styles-CaABMoO1.js.map +0 -1
- package/dist/chunks/styles-P_gmFAOi.js +0 -770
- package/dist/chunks/styles-P_gmFAOi.js.map +0 -1
- package/dist/chunks/styles-yed-Cs1nmrjn.js.map +0 -1
- package/dist/chunks/writer-DvHTl36J.js +0 -449
- package/dist/chunks/writer-DvHTl36J.js.map +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import { GraphFormatError } from "@graphty/graph-format";
|
|
2
2
|
import { c as childrenCsr } from "./children-CA4coBi0.js";
|
|
3
|
-
import { d as directionNotes, p as planNodeIds, a as planEdgeIds, s as stringify, b as aspectBlock, n as noteList, c as declaredType, e as nextNodeId } from "./cx-export-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { d as directionNotes, p as planNodeIds, a as planEdgeIds, s as stringify, b as aspectBlock, n as noteList, c as declaredType, e as nextNodeId } from "./cx-export-Bt6NoqTQ.js";
|
|
4
|
+
import { p as pairFolding } from "./format-BXiAb-1h.js";
|
|
5
|
+
import { c as capabilities, L as LOSS, r as resolveExportOptions, a as checkCapabilities, e as explicitWeights } from "./export-Cha4dRFz.js";
|
|
6
|
+
import { i as isRecord, P as POSITION_COLUMN } from "./json-elements-Cq76WjnZ.js";
|
|
7
|
+
import { p as plural } from "./report-CwMfYa9J.js";
|
|
7
8
|
import { j as joinText, e as encodeChunks } from "./writer-DxjgHwSe.js";
|
|
8
|
-
import { c as cytoscapeStyledExport, C as CX_STYLE_CAPABILITIES, s as snapshotBlock, b as blockAspect, d as cytoscapeCxAspect } from "./styles-
|
|
9
|
-
import { S as STYLE_BLOCK_NAME } from "./block-
|
|
10
|
-
import { O as ORIGINAL_ID_ATTRIBUTE } from "./importer-
|
|
9
|
+
import { c as cytoscapeStyledExport, C as CX_STYLE_CAPABILITIES, s as snapshotBlock, b as blockAspect, d as cytoscapeCxAspect } from "./styles-CAVmBLgp.js";
|
|
10
|
+
import { S as STYLE_BLOCK_NAME } from "./block-yl0f_qLO.js";
|
|
11
|
+
import { O as ORIGINAL_ID_ATTRIBUTE } from "./importer-CyVZTrf0.js";
|
|
11
12
|
const CX_FORMAT = "cx";
|
|
12
13
|
const CX_LOSS = Object.freeze({
|
|
13
14
|
/**
|
|
@@ -1005,4 +1006,4 @@ export {
|
|
|
1005
1006
|
CX_LOSS as a,
|
|
1006
1007
|
cxExporter as c
|
|
1007
1008
|
};
|
|
1008
|
-
//# sourceMappingURL=exporter-
|
|
1009
|
+
//# sourceMappingURL=exporter-CA5q8ROP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exporter-DtVU80Fa.js","sources":["../../src/formats/cx/exporter.ts"],"sourcesContent":["/**\n * The CX version 1 exporter (design/graph-io/cytoscape-and-obo/design.md section 1.2): writes a\n * snapshot as the NDEx form of a CX document -- one network with at most one view, no\n * `cySubNetworks` -- which NDEx, ndex2 and Cytoscape's CX import all read.\n *\n * Aspects, in the order Cytoscape and NDEx write them: `numberVerification`, the pre-`metaData`\n * (element counts, `idCounter` on nodes, edges, citations and supports), `nodes` (`n` the label,\n * `r` the `represents` column), `edges` (`i` the `interaction` column), `nodeAttributes`,\n * `edgeAttributes` and `networkAttributes` (values as JSON strings, the spec's form), `cyTableColumn`\n * (so a column no element fills is still declared), `cartesianLayout` (y negated back to screen\n * coordinates), `cyGroups` from the parent / parents column, `cyVisualProperties` from the\n * `cx.bypass` columns, the provenance aspects a CX import created, the style rules and unknown\n * aspects a CX import kept, and `status`.\n *\n * Given styles (`exportGraph(..., { styles })`), `cyVisualProperties` holds the Cytoscape style of the rules\n * (`network`, `nodes:default` and `edges:default` with their mappings and dependencies) and a bypass for every\n * element whose value the style cannot give, and the style values the rules read are attributes. The\n * `graphty.styles` block, which graph-io hands over as a graph attribute, is written as an aspect of its own\n * (a kept one is written back the same way).\n *\n * What CX cannot hold is announced by check() before anything is written: every edge is directed\n * (W_CX_UNDIRECTED_AS_DIRECTED, W_MUTUAL_EXPANDED), node ids are integers (E_ID_CHARSET unless\n * `sanitizeIds: \"mangle\"`, which keeps the original in the `graphty:originalId` attribute the\n * importer restores), nested values are written as JSON text (W_CX_JSON_AS_STRING), and the generic\n * notes of checkCapabilities(). NaN and the infinities are written as \"NaN\" / \"Infinity\" in double\n * attributes, which read back as they were.\n */\n\nimport { type Column, GraphFormatError, type GraphSnapshot, type NodeId } from \"@graphty/graph-format\";\n\nimport { childrenCsr } from \"../../children.js\";\nimport {\n aspectBlock,\n type CxNoteFn,\n declaredType,\n directionNotes,\n nextNodeId,\n noteList,\n planEdgeIds,\n planNodeIds,\n stringify,\n type WrittenIds,\n} from \"../../common/cx-export.js\";\nimport { type PairFolding, pairFolding } from \"../../common/direction.js\";\nimport { capabilities, checkCapabilities, LOSS } from \"../../common/export.js\";\nimport { isRecord, POSITION_COLUMN } from \"../../common/json-elements.js\";\nimport { type ResolvedExportOptions, resolveExportOptions } from \"../../common/options.js\";\nimport { plural } from \"../../common/plural.js\";\nimport { type ExplicitWeights, explicitWeights } from \"../../common/weights.js\";\nimport { encodeChunks, joinText } from \"../../common/writer.js\";\nimport { cytoscapeCxAspect, type CytoscapeEmitted } from \"../../styles/cytoscape/emit.js\";\nimport { STYLE_BLOCK_NAME } from \"../../styles/io/block.js\";\nimport type { ExporterStyleOptions } from \"../../styles/io/writer.js\";\nimport { type CommonExportOptions, type ExportCapabilities, type GraphExporter, type LossNote } from \"../../types.js\";\nimport { ORIGINAL_ID_ATTRIBUTE } from \"../cx2/importer.js\";\nimport { blockAspect, CX_STYLE_CAPABILITIES, cytoscapeStyledExport, snapshotBlock } from \"./styles.js\";\n\n/** The format name. */\nconst CX_FORMAT = \"cx\";\n\n/**\n * The options of the CX exporter: the common export options; it has none of its own.\n * @category Built-in formats\n */\nexport type CxExportOptions = CommonExportOptions;\n\n/**\n * The loss notes the CX exporter's check() returns, by name. A key is the code without its\n * severity and format prefixes.\n * @category Built-in formats\n */\nexport const CX_LOSS = Object.freeze({\n /**\n * Every edge is written as directed, so an undirected graph, or the undirected edges of a mixed graph, read back\n * as directed.\n */\n UNDIRECTED_AS_DIRECTED: \"W_CX_UNDIRECTED_AS_DIRECTED\",\n /** A nested (json) column is written as a string attribute holding its JSON text. */\n JSON_AS_STRING: \"W_CX_JSON_AS_STRING\",\n /** A mutual pair is written as two directed edges without its mark. */\n MUTUAL_EXPANDED: LOSS.MUTUAL_EXPANDED,\n /**\n * An attribute named `weight` without the weight role reads back as the edge weight, or is not written when the\n * graph has weights of its own.\n */\n WEIGHT_KEY_CLASH: LOSS.WEIGHT_KEY_CLASH,\n /** A start / end / timestamp column: CX has no time. */\n TEMPORAL_DROPPED: LOSS.TEMPORAL,\n /** An attribute with a role the format has no place for is written as a plain attribute; the role is lost. */\n ROLE_DROPPED: LOSS.ROLE,\n /**\n * An attribute without a role is written where the format keeps a role (for example, a `name` column as the label), and\n * reads back with that role.\n */\n ROLE_ASSUMED: LOSS.ROLE_ASSUMED,\n /**\n * An attribute type CX stores as another (a 32-bit float as double, an unsigned integer as long, a byte as\n * integer, a dictionary as string); it reads back with that type.\n */\n DTYPE_UNSUPPORTED: LOSS.DTYPE,\n /** A multi-component column (a second view's `position@2`, a vector) is written as a list of doubles. */\n COMPONENTS_FLATTENED: LOSS.COMPONENTS,\n /** A declared default: CX has none. */\n DEFAULT_DROPPED: LOSS.DEFAULT,\n /** Declared options: CX has no enumerations. */\n OPTIONS_DROPPED: LOSS.OPTIONS,\n /**\n * Node ids the format cannot write, under `sanitizeIds: \"error\"`; the save fails with E_INVALID_ID. Pass\n * `sanitizeIds: \"mangle\"` to rewrite them.\n */\n ID_CHARSET: LOSS.ID_CHARSET,\n /** Node ids that are not integers under sanitizeIds \"mangle\": renumbered, originals kept. */\n ID_MANGLED: LOSS.ID_MANGLED,\n /** Edges without a usable integer id get generated ids. */\n EDGE_IDS_GENERATED: LOSS.EDGE_IDS_GENERATED,\n /**\n * An attribute with a role (for example, the label) is written where the format keeps that role, and reads back under the\n * name the format's importer gives it.\n */\n COLUMN_NAME_CHANGED: LOSS.COLUMN_NAME_CHANGED,\n /** An extension table other than the `cx:citations` / `cx:supports` tables a CX import creates. */\n EXTENSION_TABLE_DROPPED: LOSS.EXTENSION_TABLE,\n /** A position, stacking order or weight that is NaN or infinite: CX spells no such number there. */\n NONFINITE_AS_NULL: LOSS.NONFINITE_AS_NULL,\n /** Visual columns (color, size, shape, thickness roles): CX keeps style as visual properties, not roles. */\n VIZ_DROPPED: LOSS.VIZ,\n});\n\n/**\n * What CX version 1 keeps: directed multigraphs with self-loops, integer node ids, required\n * integer edge ids, typed string / double / integer / boolean attributes and lists of them, network\n * attributes, the position role (one view), and containment as `cyGroups`. f32, u32, u8 and dict\n * columns are written as the nearest declared type and read back as it.\n * @category Built-in formats\n */\nexport const CX_CAPABILITIES: ExportCapabilities = capabilities({\n mixedDirection: false,\n multiEdges: true,\n selfLoops: true,\n edgeIds: \"required\",\n idCharset: \"integer\",\n dtypes: [\"string\", \"f64\", \"i32\", \"bool\"],\n components: false,\n lists: true,\n json: false,\n defaults: false,\n options: false,\n hierarchy: true,\n temporal: \"none\",\n graphAttributes: true,\n positions: true,\n viz: false,\n});\n\n/** The roles CX has a slot for, and the column names its importer gives them. */\nconst SLOT_ROLES: ReadonlySet<string> = new Set([\"label\", \"position\", \"id\"]);\nconst ROLE_NAMES: Readonly<Record<string, string>> = Object.freeze({\n label: \"name\",\n position: POSITION_COLUMN,\n id: \"id\",\n parent: \"parent\",\n});\n\n/** Roles whose columns are never written as attributes. */\nconst SKIPPED_ROLES: ReadonlySet<string> = new Set([\n \"directed\",\n \"pair\",\n \"mutual\",\n \"weight\",\n \"timeText\",\n \"originalId\",\n \"parent\",\n \"parents\",\n \"start\",\n \"end\",\n \"timestamp\",\n \"timestamps\",\n \"spells\",\n \"open\",\n \"spellsOpen\",\n \"position\",\n \"color\",\n \"size\",\n \"shape\",\n \"thickness\",\n \"id\",\n]);\n\n/** The origin namespace of the per-element visual property columns of a CX import. */\nconst BYPASS_NAMESPACE = \"cx.bypass\";\n\n/** The extension tables a CX import creates from the citations and supports aspects. */\nconst PROVENANCE_TABLES: Readonly<Record<string, string>> = Object.freeze({\n \"cx:citations\": \"citations\",\n \"cx:supports\": \"supports\",\n});\n\n/**\n * Kept aspects never written back: they describe the collection, views and SUIDs of the file the\n * snapshot came from, or are written by the exporter itself.\n */\nconst NEVER_WRITTEN: ReadonlySet<string> = new Set([\n \"nodes\",\n \"edges\",\n \"nodeAttributes\",\n \"edgeAttributes\",\n \"networkAttributes\",\n \"cartesianLayout\",\n \"cyGroups\",\n \"cyVisualProperties\",\n \"cyTableColumn\",\n \"cySubNetworks\",\n \"cyNetworkRelations\",\n \"cyViews\",\n \"CX Element ID\",\n \"citations\",\n \"supports\",\n \"nodeCitations\",\n \"edgeCitations\",\n \"nodeSupports\",\n \"edgeSupports\",\n \"functionTerms\",\n \"reifiedEdges\",\n \"numberVerification\",\n \"metaData\",\n \"status\",\n \"groups\",\n \"subnetwork\",\n STYLE_BLOCK_NAME,\n]);\n\n/** The weight attribute name (the CX importer's weightFrom default). */\nconst WEIGHT_ATTRIBUTE = \"weight\";\n\n/** The dtypes a plain `weight` column may have to be written as the weight. */\nconst NUMERIC_DTYPES: ReadonlySet<string> = new Set([\"f32\", \"f64\", \"i32\", \"u32\", \"u8\"]);\n\n/** One attribute column as it will be written. */\ninterface AttributePlan {\n readonly column: Column;\n /** The attribute name written in n. */\n readonly name: string;\n /** The declared type text. */\n readonly d: string;\n}\n\n/** A core field (n, r, i) and the column it comes from. */\ninterface CorePlan {\n readonly key: \"n\" | \"r\" | \"i\";\n readonly column: Column;\n}\n\n/** The edge weights as written: explicit weights or a plain numeric `weight` column. */\ninterface WeightPlan {\n /**\n * The weight of an edge, or undefined when none is written.\n * @param e - the edge index\n * @returns the value\n */\n value(e: number): number | undefined;\n}\n\n/** Everything export() and check() need, computed once. */\ninterface Plan {\n readonly notes: LossNote[];\n readonly fatal: GraphFormatError | null;\n readonly ids: WrittenIds | null;\n readonly folding: PairFolding;\n readonly edgeIds: readonly number[];\n readonly weight: WeightPlan | null;\n readonly nodeCore: readonly CorePlan[];\n readonly edgeCore: readonly CorePlan[];\n readonly nodeAttrs: readonly AttributePlan[];\n readonly edgeAttrs: readonly AttributePlan[];\n readonly graphAttrs: readonly AttributePlan[];\n readonly position: Column | null;\n readonly positionZ: boolean;\n readonly z: Column | null;\n readonly bypass: {\n readonly node: readonly Column[];\n readonly edge: readonly Column[];\n readonly graph: readonly Column[];\n };\n readonly collapsed: Column | null;\n readonly links: readonly LinkPlan[];\n readonly functionTerm: Column | null;\n readonly reifiedEdge: Column | null;\n}\n\n/** A citations / supports list column and the aspect it is written to. */\ninterface LinkPlan {\n readonly aspect: string;\n readonly key: \"citations\" | \"supports\";\n readonly domain: \"node\" | \"edge\";\n readonly column: Column;\n}\n\n/**\n * Whether a column was created by the CX importer in an origin namespace.\n * @param column - the column\n * @param namespace - the namespace\n * @returns true when it was\n */\nfunction fromCx(column: Column, namespace: string): boolean {\n return column.meta.origin?.format === CX_FORMAT && column.meta.origin.namespace === namespace;\n}\n\n/**\n * Whether a column is a bypass column of a CX import.\n * @param column - the column\n * @returns true for the cx.bypass namespace\n */\nfunction isBypass(column: Column): boolean {\n return column.meta.origin?.namespace === BYPASS_NAMESPACE;\n}\n\n/**\n * Whether a column is the z (stacking order) column.\n * @param column - the column\n * @returns true for the column marked by a Cytoscape-family importer\n */\nfunction isZ(column: Column): boolean {\n return column.meta.extra.cytoscape === \"z\";\n}\n\n/**\n * Whether a column is a provenance list column (citations / supports) of a CX import.\n * @param column - the column\n * @returns true for one\n */\nfunction isLink(column: Column): boolean {\n return (\n fromCx(column, \"provenance\") &&\n column.meta.dtype === \"list\" &&\n (column.meta.name === \"citations\" || column.meta.name === \"supports\")\n );\n}\n\n/**\n * Whether a column holds a text the core fields (n, r, i) cannot hold as itself.\n * @param column - the column\n * @returns true for every dtype but string (dict and json have their own notes)\n */\nfunction coreNeedsText(column: Column): boolean {\n const { dtype } = column.meta;\n return dtype !== \"string\" && dtype !== \"dict\" && dtype !== \"json\";\n}\n\n/**\n * The notes of checkCapabilities(), adapted to CX: json columns are written as JSON text, the id\n * notes are counted by planNodeIds(), the provenance tables and columns a CX import made are\n * written back.\n * @param snapshot - the snapshot\n * @param common - the resolved common options\n * @param several - whether the parents column gives some node several parents\n * @param own - the functionTerm and reifiedEdge columns written as their own aspects\n * @param notes - the notes so far\n * @param note - records a note\n * @returns the error export() throws for mixed direction, or null\n */\nfunction genericNotes(\n snapshot: GraphSnapshot,\n common: ResolvedExportOptions,\n several: boolean,\n own: readonly (Column | null)[],\n notes: LossNote[],\n note: CxNoteFn,\n): GraphFormatError | null {\n let fatal: GraphFormatError | null = null;\n const edgeLabel = snapshot.edges.byRole(\"label\")?.meta.name;\n const ownNames = new Set(own.filter((c): c is Column => c !== null).map((c) => c.meta.name));\n for (const gen of checkCapabilities(snapshot, CX_CAPABILITIES, common, {\n roles: SLOT_ROLES,\n // a parents column reads back as parents only when some node has several parents\n roleNames: several ? { ...ROLE_NAMES, parents: \"parents\" } : ROLE_NAMES,\n })) {\n if (writtenOtherwise(gen, ownNames)) {\n continue;\n }\n if (gen.code === LOSS.JSON) {\n const which = gen.column === null ? \"a column\" : `column \"${gen.column}\"`;\n note(\n CX_LOSS.JSON_AS_STRING,\n `${which} holds nested values; written as a string attribute holding their JSON text`,\n gen.column,\n gen.count,\n );\n continue;\n }\n if (isEdgeLabelRename(gen, edgeLabel)) {\n // only nodes have a label slot (n); an edge label is a plain attribute\n note(\n LOSS.ROLE,\n `edge column \"${edgeLabel ?? \"\"}\" (label) is written as a plain attribute; CX edges have no label slot and the role is lost`,\n gen.column,\n gen.count,\n );\n continue;\n }\n if (gen.code === LOSS.MIXED_DIRECTION_ERROR && fatal === null) {\n fatal = new GraphFormatError(\"E_DIRECTED\", gen.message, { reason: \"mixed direction\" });\n }\n notes.push(gen);\n }\n if (edgeLabel === \"name\") {\n note(\n LOSS.ROLE,\n `edge column \"name\" (label) is written as a plain attribute; CX edges have no label slot and the role is lost`,\n \"name\",\n null,\n );\n }\n return fatal;\n}\n\n/**\n * Whether a generic note is about something CX writes another way: the functionTerm and\n * reifiedEdge columns (their own aspects), ids (counted by planNodeIds(), since CX also keeps\n * integer ids beyond 2^53, which the generic rule refuses) and the provenance tables.\n * @param gen - the generic note\n * @param ownNames - the names of the columns written as their own aspects\n * @returns true when the note does not apply\n */\nfunction writtenOtherwise(gen: LossNote, ownNames: ReadonlySet<string>): boolean {\n if (gen.column !== null && ownNames.has(gen.column) && (gen.code === LOSS.JSON || gen.code === LOSS.DTYPE)) {\n return true;\n }\n if (gen.code === LOSS.ID_CHARSET || gen.code === LOSS.ID_MANGLED) {\n return true;\n }\n return gen.code === LOSS.EXTENSION_TABLE && gen.column !== null && gen.column in PROVENANCE_TABLES;\n}\n\n/**\n * Whether a generic note is the rename of the edge label column.\n * @param gen - the generic note\n * @param edgeLabel - the edge label column's name, if any\n * @returns true when it is\n */\nfunction isEdgeLabelRename(gen: LossNote, edgeLabel: string | undefined): boolean {\n return gen.code === LOSS.COLUMN_NAME_CHANGED && gen.column === edgeLabel && gen.message.startsWith(\"edge column\");\n}\n\n/**\n * The node positions to write: the position column, the z column (when it fits the layout), whether\n * the position's third coordinate is written as z, and the count of non-finite values left out.\n * @param snapshot - the snapshot\n * @param note - records a note\n * @returns the position plan\n */\nfunction planPositions(\n snapshot: GraphSnapshot,\n note: CxNoteFn,\n): { position: Column | null; z: Column | null; positionZ: boolean; nonfinite: number } {\n const position = snapshot.nodes.byRole(\"position\");\n const zColumn = [...snapshot.nodes].find(isZ) ?? null;\n const z = zColumn !== null && zFitsLayout(zColumn, position) ? zColumn : null;\n if (position === null) {\n return { position, z, positionZ: false, nonfinite: 0 };\n }\n let nonfinite = nonFiniteCells(position, (v) => [v[0], v[1]]);\n const depth = nonFiniteCells(position, (v) => (v[2] === 0 ? [] : [Number.NaN]));\n const positionZ = zColumn === null && (position.meta.extra.sourceDims === 3 || depth > 0);\n if (positionZ) {\n nonfinite += nonFiniteCells(position, (v) => (Number.isFinite(v[0]) && Number.isFinite(v[1]) ? [v[2]] : []));\n note(\n LOSS.COMPONENTS,\n `node column \"${position.meta.name}\" (position) has a third coordinate; CX writes it as the layout's z, which reads back in the z column (a stacking order), not in the position`,\n position.meta.name,\n depth,\n );\n }\n return { position, z, positionZ, nonfinite };\n}\n\n/**\n * Note the graph columns that read back as the graph's name or description.\n * @param snapshot - the snapshot\n * @param note - records a note\n */\nfunction graphColumnNotes(snapshot: GraphSnapshot, note: CxNoteFn): void {\n for (const c of snapshot.graph) {\n const named = c.meta.name === \"name\" || c.meta.name === \"description\";\n if (!isBypass(c) && named && (c.dtype === \"string\" || c.dtype === \"dict\")) {\n note(\n LOSS.ROLE_ASSUMED,\n `graph column \"${c.meta.name}\" is written as the network attribute ${c.meta.name}, which reads back as the graph's ${c.meta.name}, not as a column`,\n c.meta.name,\n null,\n );\n }\n }\n}\n\n/**\n * Plan an export: the notes, the fatal condition and what is written.\n * @param snapshot - the snapshot\n * @param common - the resolved common options\n * @returns the plan\n */\nfunction plan(snapshot: GraphSnapshot, common: ResolvedExportOptions): Plan {\n const { notes, note } = noteList();\n const functionTerm =\n [...snapshot.nodes].find((c) => fromCx(c, \"provenance\") && c.meta.name === \"functionTerm\") ?? null;\n const reifiedEdge = [...snapshot.nodes].find((c) => fromCx(c, \"reifiedEdges\") && c.dtype === \"u32\") ?? null;\n const children = childrenCsr(snapshot);\n const several = children.column?.meta.role === \"parents\" && severalParents(children.column);\n let fatal = genericNotes(snapshot, common, several, [functionTerm, reifiedEdge], notes, note);\n\n const folding = pairFolding(snapshot);\n directionNotes(snapshot, folding, common, CX_LOSS.UNDIRECTED_AS_DIRECTED, note);\n const planned = planNodeIds(snapshot, common, \"CX\", ORIGINAL_ID_ATTRIBUTE, note);\n const ids = planned instanceof GraphFormatError ? null : planned;\n if (planned instanceof GraphFormatError) {\n fatal ??= planned;\n }\n const edgeIds = planEdgeIds(snapshot, note, ids);\n if (snapshot.nodes.has(ORIGINAL_ID_ATTRIBUTE)) {\n note(\n LOSS.ROLE_ASSUMED,\n `node column \"${ORIGINAL_ID_ATTRIBUTE}\" is the importer's record of mangled ids: it reads back as the node ids unless restoreMangledIds is false`,\n ORIGINAL_ID_ATTRIBUTE,\n null,\n );\n }\n\n // nodes: n, r, the z column, the groups' collapsed flags, provenance\n const positions = planPositions(snapshot, note);\n const { position, z, positionZ } = positions;\n let { nonfinite } = positions;\n const collapsed = [...snapshot.nodes].find((c) => fromCx(c, \"cyGroups\") && c.dtype === \"bool\") ?? null;\n const nodeCore = corePlans(snapshot, note);\n const edgeCore: CorePlan[] = [];\n const interaction = snapshot.edges.get(\"interaction\");\n if (interaction !== null && (interaction.meta.role === null || !SKIPPED_ROLES.has(interaction.meta.role))) {\n edgeCore.push({ key: \"i\", column: interaction });\n coreTextNote(interaction, \"edge\", note);\n }\n\n const coreColumns = new Set<Column>([...nodeCore, ...edgeCore].map((c) => c.column));\n const special = (c: Column): boolean =>\n coreColumns.has(c) ||\n isBypass(c) ||\n isLink(c) ||\n c === z ||\n c === collapsed ||\n c === functionTerm ||\n c === reifiedEdge ||\n (c.meta.role !== null && SKIPPED_ROLES.has(c.meta.role));\n\n const label = snapshot.nodes.byRole(\"label\");\n const renamedName = label !== null && label.meta.name !== \"name\" ? snapshot.nodes.get(\"name\") : null;\n if (renamedName !== null) {\n note(\n LOSS.COLUMN_NAME_CHANGED,\n `node column \"name\" is written as the attribute \"name#2\" and reads back as \"name#2\", because the label column \"${label?.meta.name ?? \"\"}\" is written as n and takes the name \"name\"`,\n \"name\",\n renamedName.length - renamedName.nullCount,\n );\n }\n const nodeAttrs = attributePlans(snapshot.nodes, special, (c) => (c === renamedName ? \"name#2\" : c.meta.name));\n\n const weight = planWeight(snapshot, folding, note);\n const plainWeight = snapshot.edges.get(WEIGHT_ATTRIBUTE);\n const edgeAttrs = attributePlans(\n snapshot.edges,\n (c) => special(c) || (c === plainWeight && c.meta.role === null),\n (c) => c.meta.name,\n );\n nonfinite += weight.nonfinite;\n\n graphColumnNotes(snapshot, note);\n // the graphty.styles block is an aspect of its own\n const graphAttrs = attributePlans(\n snapshot.graph,\n (c) => isBypass(c) || c.meta.name === STYLE_BLOCK_NAME,\n (c) => c.meta.name,\n );\n\n if (children.column !== null && children.column.meta.role === \"parents\" && !several) {\n note(\n LOSS.COLUMN_NAME_CHANGED,\n `node column \"${children.column.meta.name}\" (parents) holds at most one parent per node; it reads back as the single-parent column \"parent\"`,\n children.column.meta.name,\n children.column.length - children.column.nullCount,\n );\n }\n\n if (nonfinite > 0) {\n note(\n LOSS.NONFINITE_AS_NULL,\n `${nonfinite} NaN or infinite position${plural(nonfinite)}, stacking orders or weights cannot be written in CX; they read back unset`,\n null,\n nonfinite,\n );\n }\n return {\n notes,\n fatal,\n ids,\n folding,\n edgeIds,\n weight: weight.plan,\n nodeCore,\n edgeCore,\n nodeAttrs,\n edgeAttrs,\n graphAttrs,\n position,\n positionZ,\n z,\n bypass: {\n node: [...snapshot.nodes].filter(isBypass),\n edge: [...snapshot.edges].filter(isBypass),\n graph: [...snapshot.graph].filter(isBypass),\n },\n collapsed,\n links: linkPlans(snapshot),\n functionTerm,\n reifiedEdge,\n };\n}\n\n/**\n * The node core fields: n from the label column (else a plain `name` column, which then reads back\n * as the label), r from a `represents` column.\n * @param snapshot - the snapshot\n * @param note - records a note\n * @returns the plans\n */\nfunction corePlans(snapshot: GraphSnapshot, note: CxNoteFn): CorePlan[] {\n const out: CorePlan[] = [];\n const label = snapshot.nodes.byRole(\"label\");\n const plainName = snapshot.nodes.get(\"name\");\n const n = label ?? (plainName !== null && plainName.meta.role === null ? plainName : null);\n if (n !== null) {\n out.push({ key: \"n\", column: n });\n coreTextNote(n, \"node\", note);\n if (n !== label) {\n note(\n LOSS.ROLE_ASSUMED,\n `node column \"name\" is written as n and reads back as the label`,\n \"name\",\n n.length - n.nullCount,\n );\n }\n }\n const represents = snapshot.nodes.get(\"represents\");\n if (\n represents !== null &&\n represents !== n &&\n (represents.meta.role === null || !SKIPPED_ROLES.has(represents.meta.role))\n ) {\n out.push({ key: \"r\", column: represents });\n coreTextNote(represents, \"node\", note);\n }\n return out;\n}\n\n/**\n * The note of a core field column that is not text: n, r and i are strings in CX.\n * @param column - the column\n * @param domain - node or edge\n * @param note - records a note\n */\nfunction coreTextNote(column: Column, domain: string, note: CxNoteFn): void {\n if (coreNeedsText(column)) {\n note(\n LOSS.DTYPE,\n `${domain} column \"${column.meta.name}\" is ${column.dtype}; CX writes it as text and it reads back as string`,\n column.meta.name,\n column.length - column.nullCount,\n );\n }\n}\n\n/**\n * The attribute plans of one table.\n * @param table - the table\n * @param skip - columns not written as attributes\n * @param rename - the written name of a column\n * @returns the plans\n */\nfunction attributePlans(\n table: Iterable<Column>,\n skip: (column: Column) => boolean,\n rename: (column: Column) => string,\n): AttributePlan[] {\n return [...table]\n .filter((c) => !skip(c))\n .map((column) => ({ column, name: rename(column), d: declaredType(column) }));\n}\n\n/**\n * The weights to write: the explicit weights, else a plain numeric `weight` column (which then\n * reads back as THE weight); a plain `weight` column that is not written is noted.\n * @param snapshot - the snapshot\n * @param folding - the pair folding\n * @param note - records a note\n * @returns the plan, or null for no weight attribute, and the count of non-finite weights skipped\n */\nfunction planWeight(\n snapshot: GraphSnapshot,\n folding: PairFolding,\n note: CxNoteFn,\n): { plan: WeightPlan | null; nonfinite: number } {\n const weights: ExplicitWeights = explicitWeights(snapshot);\n const plain = snapshot.edges.get(WEIGHT_ATTRIBUTE);\n const clash = plain !== null && plain.meta.role === null;\n let plan: WeightPlan | null = null;\n if (weights.weighted) {\n plan = { value: (e) => (weights.isExplicit(e) ? weights.value(e) : undefined) };\n if (clash) {\n note(\n LOSS.WEIGHT_KEY_CLASH,\n `edge column \"${WEIGHT_ATTRIBUTE}\" is not written: the explicit weights are written under that name`,\n WEIGHT_ATTRIBUTE,\n null,\n );\n }\n } else if (clash) {\n const numeric = NUMERIC_DTYPES.has(plain.dtype);\n note(\n LOSS.WEIGHT_KEY_CLASH,\n numeric\n ? `edge column \"${WEIGHT_ATTRIBUTE}\" is written as the weight attribute and reads back as the edge weight`\n : `edge column \"${WEIGHT_ATTRIBUTE}\" is ${plain.dtype}, and CX reads that attribute as the edge weight; it is not written`,\n WEIGHT_ATTRIBUTE,\n null,\n );\n if (numeric) {\n plan = { value: (e) => (plain.isSet(e) ? (plain.value(e) as number) : undefined) };\n }\n }\n return { plan, nonfinite: plan === null ? 0 : nanWeights(snapshot.edgeCount, plan, folding) };\n}\n\n/**\n * The written weights that are NaN, which is not a weight on re-import (the infinities are).\n * @param edgeCount - the number of edges\n * @param plan - the weight plan\n * @param folding - the pair folding\n * @returns the count\n */\nfunction nanWeights(edgeCount: number, plan: WeightPlan, folding: PairFolding): number {\n let nan = 0;\n for (let e = 0; e < edgeCount; e++) {\n const w = plan.value(e);\n if (!folding.folded(e) && w !== undefined && Number.isNaN(w)) {\n nan++;\n }\n }\n return nan;\n}\n\n/**\n * Whether the z column can go into cartesianLayout: every set z is finite and its node has a\n * finite position (a layout entry needs x and y). Otherwise it is written as an ordinary attribute.\n * @param z - the z column\n * @param position - the position column\n * @returns true when every z fits a layout entry\n */\nfunction zFitsLayout(z: Column, position: Column | null): boolean {\n for (let i = 0; i < z.length; i++) {\n if (!z.isSet(i)) {\n continue;\n }\n const value = z.value(i);\n const point = position?.isSet(i) === true ? (position.value(i) as ArrayLike<number>) : null;\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value) ||\n point === null ||\n !Number.isFinite(point[0]) ||\n !Number.isFinite(point[1])\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Count the set cells of a multi-component column with a non-finite component among those picked.\n * @param column - the column\n * @param pick - the components that are written\n * @returns the count\n */\nfunction nonFiniteCells(column: Column, pick: (value: ArrayLike<number>) => number[]): number {\n let count = 0;\n for (let i = 0; i < column.length; i++) {\n if (column.isSet(i) && pick(column.value(i) as ArrayLike<number>).some((v) => !Number.isFinite(v))) {\n count++;\n }\n }\n return count;\n}\n\n/**\n * Whether a parents column gives some node more than one parent.\n * @param column - the parents list column\n * @returns true when one does\n */\nfunction severalParents(column: Column): boolean {\n for (let i = 0; i < column.length; i++) {\n if (column.isSet(i) && (column.value(i) as ArrayLike<unknown>).length > 1) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The citations / supports list columns of a CX import and the aspects they go to.\n * @param snapshot - the snapshot\n * @returns the plans\n */\nfunction linkPlans(snapshot: GraphSnapshot): LinkPlan[] {\n const out: LinkPlan[] = [];\n for (const [domain, table] of [\n [\"node\", snapshot.nodes],\n [\"edge\", snapshot.edges],\n ] as const) {\n for (const column of table) {\n if (isLink(column)) {\n const key = column.meta.name as \"citations\" | \"supports\";\n out.push({ aspect: `${domain}${key === \"citations\" ? \"Citations\" : \"Supports\"}`, key, domain, column });\n }\n }\n }\n return out;\n}\n\n// ============================================================ writing\n\n/**\n * The text of a scalar the way Cytoscape writes CX values: numbers by their shortest decimal\n * (\"-0\", \"NaN\", \"Infinity\" included), booleans as \"true\" / \"false\".\n * @param value - the value\n * @returns the text\n */\nfunction scalarText(value: unknown): string {\n if (typeof value === \"number\") {\n return Object.is(value, -0) ? \"-0\" : String(value);\n }\n if (typeof value === \"string\") {\n return value;\n }\n return typeof value === \"boolean\" ? String(value) : JSON.stringify(value);\n}\n\n/**\n * The v of one cell: a JSON string, or an array of strings for a list type.\n * @param column - the column\n * @param d - its declared type\n * @param row - the row\n * @returns the value, or undefined for an unset cell\n */\nfunction cellValue(column: Column, d: string, row: number): unknown {\n if (!column.isSet(row)) {\n return undefined;\n }\n const value = column.value(row);\n if (column.meta.dtype === \"json\") {\n return JSON.stringify(value);\n }\n if (column.meta.dtype === \"list\" || column.meta.components > 1) {\n const items = Array.from(value as ArrayLike<unknown>);\n return d === \"string\" ? JSON.stringify(items) : items.map(scalarText);\n }\n return scalarText(value);\n}\n\n/**\n * The text a core field (n, r, i) holds for one row.\n * @param column - the column\n * @param row - the row\n * @returns the text, or undefined for an unset cell\n */\nfunction coreText(column: Column, row: number): string | undefined {\n if (!column.isSet(row)) {\n return undefined;\n }\n const value = column.value(row);\n if (column.meta.dtype === \"json\" || column.meta.dtype === \"list\" || column.meta.components > 1) {\n return JSON.stringify(column.meta.dtype === \"json\" ? value : Array.from(value as ArrayLike<unknown>));\n }\n return scalarText(value);\n}\n\n/** One aspect to write: its name, its elements (produced twice: once to count them) and its idCounter. */\ninterface Aspect {\n readonly name: string;\n readonly elements: () => Iterable<unknown>;\n readonly idCounter?: NodeId | undefined;\n}\n\n/**\n * The written edges: every logical edge but the folded halves of pairs.\n * @param snapshot - the snapshot\n * @param folding - the pair folding\n * @returns the edge indexes\n */\nfunction writtenEdges(snapshot: GraphSnapshot, folding: PairFolding): number[] {\n const out: number[] = [];\n for (let e = 0; e < snapshot.edgeCount; e++) {\n if (!folding.folded(e)) {\n out.push(e);\n }\n }\n return out;\n}\n\n/**\n * Build every aspect of the document, in the order Cytoscape and NDEx write them.\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param ids - the written node ids\n * @param styled - the styles as a Cytoscape style, or null without styles\n * @returns the aspects (those without elements included; the writer skips them)\n */\nfunction aspects(snapshot: GraphSnapshot, p: Plan, ids: WrittenIds, styled: CytoscapeEmitted | null): Aspect[] {\n const { src, dst } = snapshot.edgeList();\n const edges = writtenEdges(snapshot, p.folding);\n const nodeRange = (): number[] => Array.from({ length: snapshot.nodeCount }, (_, i) => i);\n const nodeCore = (key: \"n\" | \"r\"): Column | null => p.nodeCore.find((c) => c.key === key)?.column ?? null;\n const n = nodeCore(\"n\");\n const r = nodeCore(\"r\");\n const i = p.edgeCore[0]?.column ?? null;\n const kept =\n snapshot.meta.sourceFormat === CX_FORMAT && isRecord(snapshot.meta.extra.cx) ? snapshot.meta.extra.cx : {};\n\n const out: Aspect[] = [\n {\n name: \"nodes\",\n idCounter: nextNodeId(ids, snapshot.nodeCount),\n *elements() {\n for (let row = 0; row < snapshot.nodeCount; row++) {\n const element: Record<string, unknown> = { \"@id\": ids.idAt(row) };\n const name = n === null ? undefined : coreText(n, row);\n const represents = r === null ? undefined : coreText(r, row);\n if (name !== undefined) {\n element.n = name;\n }\n if (represents !== undefined) {\n element.r = represents;\n }\n yield element;\n }\n },\n },\n {\n name: \"edges\",\n idCounter: edges.reduce((max, e) => Math.max(max, p.edgeIds[e] + 1), 0),\n *elements() {\n for (const e of edges) {\n const element: Record<string, unknown> = {\n \"@id\": p.edgeIds[e],\n s: ids.idAt(src[e]),\n t: ids.idAt(dst[e]),\n };\n const interaction = i === null ? undefined : coreText(i, e);\n if (interaction !== undefined) {\n element.i = interaction;\n }\n yield element;\n }\n },\n },\n {\n name: \"nodeAttributes\",\n *elements() {\n for (const a of p.nodeAttrs) {\n for (let row = 0; row < snapshot.nodeCount; row++) {\n const v = cellValue(a.column, a.d, row);\n if (v !== undefined) {\n yield { po: ids.idAt(row), n: a.name, v, d: a.d };\n }\n }\n }\n for (let row = 0; row < snapshot.nodeCount; row++) {\n if (ids.isChanged(row)) {\n yield {\n po: ids.idAt(row),\n n: ORIGINAL_ID_ATTRIBUTE,\n v: String(ids.originalAt(row)),\n d: \"string\",\n };\n }\n }\n },\n },\n {\n name: \"edgeAttributes\",\n *elements() {\n for (const a of p.edgeAttrs) {\n for (const e of edges) {\n const v = cellValue(a.column, a.d, e);\n if (v !== undefined) {\n yield { po: p.edgeIds[e], n: a.name, v, d: a.d };\n }\n }\n }\n if (p.weight !== null) {\n for (const e of edges) {\n const w = p.weight.value(e);\n if (w !== undefined && !Number.isNaN(w)) {\n yield { po: p.edgeIds[e], n: WEIGHT_ATTRIBUTE, v: scalarText(w), d: \"double\" };\n }\n }\n }\n },\n },\n {\n name: \"networkAttributes\",\n *elements() {\n for (const a of p.graphAttrs) {\n const v = cellValue(a.column, a.d, 0);\n if (v !== undefined) {\n yield { n: a.name, v, d: a.d };\n }\n }\n const { meta } = snapshot;\n for (const [key, value] of [\n [\"name\", meta.name],\n [\"description\", meta.description],\n ] as const) {\n if (value !== null && !p.graphAttrs.some((a) => a.name === key)) {\n yield { n: key, v: value, d: \"string\" };\n }\n }\n },\n },\n { name: \"cyTableColumn\", elements: () => tableColumns(p, ids) },\n { name: \"cartesianLayout\", elements: () => layoutElements(p, ids, nodeRange()) },\n { name: \"cyGroups\", elements: () => groupElements(snapshot, p, ids, edges) },\n {\n name: \"cyVisualProperties\",\n elements: () =>\n styled === null\n ? visualProperties(p, ids, nodeRange(), edges, kept)\n : styledVisualProperties(styled, ids, p.edgeIds, edges),\n },\n ];\n const block = snapshotBlock(snapshot);\n if (block !== null) {\n out.push({ name: STYLE_BLOCK_NAME, elements: () => blockAspect(block) });\n }\n out.push(...provenanceAspects(snapshot, p, ids, edges));\n for (const [name, value] of Object.entries(kept)) {\n if (!NEVER_WRITTEN.has(name) && Array.isArray(value)) {\n out.push({ name, elements: () => keptElements(value, kept.subnetwork, STYLE_ASPECTS.has(name)) });\n }\n }\n return out;\n}\n\n/**\n * The cyTableColumn entries: every written column with its type, so a column no element fills is\n * still declared on re-import.\n * @param p - the plan\n * @param ids - the written ids\n * @yields the entries\n */\nfunction* tableColumns(p: Plan, ids: WrittenIds): Generator<unknown, void, undefined> {\n for (const { key, column } of [...p.nodeCore, ...p.edgeCore]) {\n const n = { n: \"name\", r: \"represents\", i: \"interaction\" }[key];\n if (n !== undefined && column !== null) {\n yield { applies_to: key === \"i\" ? \"edge_table\" : \"node_table\", n, d: \"string\" };\n }\n }\n for (const a of p.nodeAttrs) {\n yield { applies_to: \"node_table\", n: a.name, d: a.d };\n }\n if (ids.changed > 0) {\n yield { applies_to: \"node_table\", n: ORIGINAL_ID_ATTRIBUTE, d: \"string\" };\n }\n for (const a of p.edgeAttrs) {\n yield { applies_to: \"edge_table\", n: a.name, d: a.d };\n }\n if (p.weight !== null) {\n yield { applies_to: \"edge_table\", n: WEIGHT_ATTRIBUTE, d: \"double\" };\n }\n for (const a of p.graphAttrs) {\n yield { applies_to: \"network_table\", n: a.name, d: a.d };\n }\n}\n\n/** Kept aspects whose view references are rewritten to the one view of the written file. */\nconst STYLE_ASPECTS: ReadonlySet<string> = new Set([\"tableVisualProperties\", \"cyTableVisualProperties\"]);\n\n/**\n * The elements of a kept aspect: those of the snapshot's own subnetwork (or unscoped), with the\n * scope dropped; style elements get their view references rewritten to view 0.\n * @param elements - the kept elements\n * @param subnetwork - the subnetwork the snapshot was read from, if any\n * @param style - whether the aspect is a style aspect\n * @yields the elements to write\n */\nfunction* keptElements(\n elements: readonly unknown[],\n subnetwork: unknown,\n style: boolean,\n): Generator<unknown, void, undefined> {\n for (const element of elements) {\n if (!isRecord(element)) {\n yield element;\n continue;\n }\n if (element.s !== undefined && element.s !== null && element.s !== subnetwork) {\n continue;\n }\n const { s: _scope, ...rest } = element;\n yield style ? rewriteView(rest) : rest;\n }\n}\n\n/**\n * A style element with its view and subnetwork references rewritten to 0, the written network.\n * @param element - the element\n * @returns the rewritten element\n */\nfunction rewriteView(element: Record<string, unknown>): Record<string, unknown> {\n const out = { ...element };\n if (\"view\" in out) {\n out.view = 0;\n }\n if (typeof out.applies_to === \"number\") {\n out.applies_to = 0;\n }\n return out;\n}\n\n/**\n * The cartesianLayout entries: x / y (y negated back to screen coordinates) and z.\n * @param p - the plan\n * @param ids - the written ids\n * @param rows - every node row\n * @yields the entries\n */\nfunction* layoutElements(p: Plan, ids: WrittenIds, rows: readonly number[]): Generator<unknown, void, undefined> {\n const { position } = p;\n if (position === null) {\n return;\n }\n for (const row of rows) {\n if (!position.isSet(row)) {\n continue;\n }\n const point = position.value(row) as ArrayLike<number>;\n if (!Number.isFinite(point[0]) || !Number.isFinite(point[1])) {\n continue;\n }\n const entry: Record<string, unknown> = { node: ids.idAt(row), x: point[0], y: point[1] === 0 ? 0 : -point[1] };\n if (p.z?.isSet(row) === true) {\n entry.z = p.z.value(row);\n } else if (p.positionZ && Number.isFinite(point[2])) {\n entry.z = point[2];\n }\n yield entry;\n }\n}\n\n/**\n * The cyGroups entries: one per node that has members (or a collapsed flag), its members, and the\n * edges with both ends (internal) or one end (external) among them.\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param ids - the written ids\n * @param edges - the written edges\n * @yields the entries\n */\nfunction* groupElements(\n snapshot: GraphSnapshot,\n p: Plan,\n ids: WrittenIds,\n edges: readonly number[],\n): Generator<unknown, void, undefined> {\n const children = childrenCsr(snapshot);\n const groupsOf = new Map<number, number[]>();\n const groups: number[] = [];\n for (let g = 0; g < snapshot.nodeCount; g++) {\n const members = children.childrenOf(g);\n if (members.length > 0 || p.collapsed?.isSet(g) === true) {\n groups.push(g);\n }\n for (const c of members) {\n groupsOf.set(c, [...(groupsOf.get(c) ?? []), g]);\n }\n }\n if (groups.length === 0) {\n return;\n }\n const { internal, external } = groupEdges(snapshot, p, groupsOf, edges);\n const label = p.nodeCore.find((c) => c.key === \"n\")?.column ?? null;\n for (const g of groups) {\n const entry: Record<string, unknown> = { \"@id\": ids.idAt(g) };\n const name = label === null ? undefined : coreText(label, g);\n if (name !== undefined) {\n entry.n = name;\n }\n entry.nodes = Array.from(children.childrenOf(g), (c) => ids.idAt(c));\n entry.internal_edges = internal.get(g) ?? [];\n entry.external_edges = external.get(g) ?? [];\n if (p.collapsed?.isSet(g) === true) {\n entry.collapsed = p.collapsed.value(g);\n }\n yield entry;\n }\n}\n\n/**\n * The written edges of each group: internal (both ends among its members) and external (one end).\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param groupsOf - the groups each member node is in\n * @param edges - the written edges\n * @returns the edge ids by group\n */\nfunction groupEdges(\n snapshot: GraphSnapshot,\n p: Plan,\n groupsOf: ReadonlyMap<number, number[]>,\n edges: readonly number[],\n): { internal: Map<number, number[]>; external: Map<number, number[]> } {\n const internal = new Map<number, number[]>();\n const external = new Map<number, number[]>();\n const add = (table: Map<number, number[]>, g: number, id: number): void => {\n table.set(g, [...(table.get(g) ?? []), id]);\n };\n const { src, dst } = snapshot.edgeList();\n for (const e of edges) {\n const ofSource = groupsOf.get(src[e]) ?? [];\n const ofTarget = groupsOf.get(dst[e]) ?? [];\n for (const g of ofSource) {\n add(ofTarget.includes(g) ? internal : external, g, p.edgeIds[e]);\n }\n for (const g of ofTarget.filter((t) => !ofSource.includes(t))) {\n add(external, g, p.edgeIds[e]);\n }\n }\n return { internal, external };\n}\n\n/**\n * The visual property values of one row: property -> value text.\n * @param columns - the bypass columns\n * @param row - the row\n * @returns the properties, or null when none is set\n */\nfunction bypassValues(columns: readonly Column[], row: number): Record<string, string> | null {\n let out: Record<string, string> | null = null;\n for (const column of columns) {\n if (column.isSet(row)) {\n // the visual property's own name: a column renamed for a clash with an attribute keeps it in origin.id\n const property = column.meta.origin?.id;\n out ??= {};\n out[typeof property === \"string\" && property.length > 0 ? property : column.meta.name] = scalarText(\n column.value(row),\n );\n }\n }\n return out;\n}\n\n/**\n * The cyVisualProperties entries: the network values, the style rules a CX import kept (its own\n * view's, rewritten to view 0) and the per-element values.\n * @param p - the plan\n * @param ids - the written ids\n * @param rows - every node row\n * @param edges - the written edges\n * @param kept - meta.extra.cx of a CX import, else empty\n * @yields the entries\n */\nfunction* visualProperties(\n p: Plan,\n ids: WrittenIds,\n rows: readonly number[],\n edges: readonly number[],\n kept: Record<string, unknown>,\n): Generator<unknown, void, undefined> {\n const network = bypassValues(p.bypass.graph, 0);\n if (network !== null) {\n yield { properties_of: \"network\", properties: network };\n }\n const view = ownView(kept);\n for (const entry of Array.isArray(kept.cyVisualProperties) ? (kept.cyVisualProperties as unknown[]) : []) {\n if (\n isRecord(entry) &&\n ![\"nodes\", \"edges\", \"network\"].includes(String(entry.properties_of)) &&\n (view === null || entry.view === undefined || entry.view === null || entry.view === view)\n ) {\n yield rewriteView(entry);\n }\n }\n for (const row of rows) {\n const properties = bypassValues(p.bypass.node, row);\n if (properties !== null) {\n yield { properties_of: \"nodes\", applies_to: ids.idAt(row), properties };\n }\n }\n for (const e of edges) {\n const properties = bypassValues(p.bypass.edge, e);\n if (properties !== null) {\n yield { properties_of: \"edges\", applies_to: p.edgeIds[e], properties };\n }\n }\n}\n\n/**\n * The cyVisualProperties entries of a styled export: the style's defaults, mappings and dependencies, then every\n * element's bypasses (as text, Cytoscape's form).\n * @param styled - the styles as a Cytoscape style\n * @param ids - the written ids\n * @param edgeIds - the written edge ids\n * @param edges - the written edges\n * @yields the entries\n */\nfunction* styledVisualProperties(\n styled: CytoscapeEmitted,\n ids: WrittenIds,\n edgeIds: readonly number[],\n edges: readonly number[],\n): Generator<unknown, void, undefined> {\n yield* cytoscapeCxAspect(styled.style);\n const text = (m: ReadonlyMap<string, unknown>): Record<string, string> =>\n Object.fromEntries([...m].map(([k, v]) => [k, String(v)]));\n for (let row = 0; row < styled.bypasses.node.length; row++) {\n const m = styled.bypasses.node[row];\n if (m !== null && m.size > 0) {\n yield { properties_of: \"nodes\", applies_to: ids.idAt(row), properties: text(m) };\n }\n }\n for (const e of edges) {\n const m = styled.bypasses.edge[e];\n if (m !== null && m.size > 0) {\n yield { properties_of: \"edges\", applies_to: edgeIds[e], properties: text(m) };\n }\n }\n}\n\n/**\n * The view of the subnetwork a CX import read (the one its style rules belong to).\n * @param kept - meta.extra.cx\n * @returns the view id, or null when the file named none\n */\nfunction ownView(kept: Record<string, unknown>): unknown {\n const sub = kept.subnetwork;\n for (const r of Array.isArray(kept.cyNetworkRelations) ? (kept.cyNetworkRelations as unknown[]) : []) {\n if (isRecord(r) && r.r === \"view\" && (sub === undefined || r.p === sub)) {\n return r.c;\n }\n }\n for (const v of Array.isArray(kept.cyViews) ? (kept.cyViews as unknown[]) : []) {\n if (isRecord(v) && (sub === undefined || v.s === sub)) {\n return v[\"@id\"];\n }\n }\n return null;\n}\n\n/**\n * The provenance aspects a CX import turned into extension tables and columns, written back:\n * citations, supports, their node / edge links, functionTerms and reifiedEdges.\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param ids - the written ids\n * @param edges - the written edges\n * @returns the aspects\n */\nfunction provenanceAspects(snapshot: GraphSnapshot, p: Plan, ids: WrittenIds, edges: readonly number[]): Aspect[] {\n const out: Aspect[] = [];\n for (const [table, aspect] of Object.entries(PROVENANCE_TABLES)) {\n const ext = snapshot.extensions.get(table);\n if (ext === undefined) {\n continue;\n }\n const idColumn = ext.get(\"id\");\n const fields = [...ext].filter((c) => c !== idColumn);\n let max = -1;\n for (let row = 0; row < ext.rowCount; row++) {\n if (idColumn?.isSet(row) === true) {\n max = Math.max(max, Number(idColumn.value(row)));\n }\n }\n out.push({\n name: aspect,\n idCounter: max + 1,\n *elements() {\n for (let row = 0; row < ext.rowCount; row++) {\n const element: Record<string, unknown> = {};\n if (idColumn?.isSet(row) === true) {\n element[\"@id\"] = idColumn.value(row);\n }\n for (const field of fields) {\n if (field.isSet(row)) {\n element[field.meta.name] = field.value(row);\n }\n }\n yield element;\n }\n },\n });\n }\n for (const link of p.links) {\n out.push({\n name: link.aspect,\n *elements() {\n const rows = link.domain === \"node\" ? Array.from({ length: snapshot.nodeCount }, (_, i) => i) : edges;\n for (const row of rows) {\n if (link.column.isSet(row)) {\n const po = link.domain === \"node\" ? ids.idAt(row) : p.edgeIds[row];\n yield { po: [po], [link.key]: Array.from(link.column.value(row) as ArrayLike<unknown>) };\n }\n }\n },\n });\n }\n const terms = p.functionTerm;\n if (terms !== null) {\n out.push({\n name: \"functionTerms\",\n *elements() {\n for (let row = 0; row < snapshot.nodeCount; row++) {\n const term = terms.isSet(row) ? terms.value(row) : null;\n if (isRecord(term)) {\n yield { po: ids.idAt(row), ...term };\n }\n }\n },\n });\n }\n const reified = p.reifiedEdge;\n if (reified !== null) {\n out.push({\n name: \"reifiedEdges\",\n *elements() {\n for (let row = 0; row < snapshot.nodeCount; row++) {\n const edge = reified.isSet(row) ? (reified.value(row) as number) : -1;\n if (edge >= 0 && edge < snapshot.edgeCount) {\n yield { node: ids.idAt(row), edge: p.edgeIds[edge] };\n }\n }\n },\n });\n }\n return out;\n}\n\n/**\n * Write the document as text parts.\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param styled - the styles as a Cytoscape style, or null without styles\n * @yields the document's text\n * @returns nothing\n */\nfunction* write(\n snapshot: GraphSnapshot,\n p: Plan,\n styled: CytoscapeEmitted | null = null,\n): Generator<string, void, undefined> {\n if (p.fatal !== null) {\n throw p.fatal;\n }\n const { ids } = p;\n if (ids === null) {\n throw new GraphFormatError(\"E_INVALID_ID\", \"node ids cannot be written as CX integers\", { reason: \"charset\" });\n }\n const all = aspects(snapshot, p, ids, styled);\n const written: { aspect: Aspect; count: number }[] = [];\n for (const aspect of all) {\n let count = 0;\n for (const _ of aspect.elements()) {\n count++;\n }\n if (count > 0 || aspect.name === \"nodes\") {\n written.push({ aspect, count });\n }\n }\n const metaData = written.map(({ aspect, count }) => ({\n name: aspect.name,\n version: \"1.0\",\n ...(aspect.idCounter === undefined ? {} : { idCounter: aspect.idCounter }),\n elementCount: count,\n consistencyGroup: 1,\n }));\n yield '[{\"numberVerification\":[{\"longNumber\":281474976710655}]},\\n';\n yield `{\"metaData\":${stringify(metaData)}},\\n`;\n for (const { aspect } of written) {\n yield* aspectBlock(aspect.name, mapIterable(aspect.elements(), stringify));\n }\n yield '{\"status\":[{\"error\":\"\",\"success\":true}]}]\\n';\n}\n\n/**\n * Map an iterable lazily.\n * @param items - the items\n * @param fn - the mapping\n * @yields the mapped items\n */\nfunction* mapIterable<T, U>(items: Iterable<T>, fn: (item: T) => U): Generator<U, void, undefined> {\n for (const item of items) {\n yield fn(item);\n }\n}\n\n/**\n * The CX version 1 exporter plugin.\n * @category Built-in formats\n */\nexport const cxExporter: GraphExporter<CxExportOptions> = Object.freeze({\n format: CX_FORMAT,\n options: Object.freeze([]),\n capabilities: CX_CAPABILITIES,\n styles: Object.freeze({ capabilities: CX_STYLE_CAPABILITIES }),\n\n /**\n * Pre-flight: what export() would lose, without writing anything.\n * @param snapshot - the snapshot\n * @param options - the common options\n * @returns the notes, empty when the export is exact\n */\n check(snapshot: GraphSnapshot, options?: CxExportOptions & ExporterStyleOptions): readonly LossNote[] {\n const styled = cytoscapeStyledExport(snapshot, options?.styles, \"desktop\");\n return Object.freeze([\n ...plan(styled?.snapshot ?? snapshot, resolveExportOptions(options)).notes,\n ...(styled?.notes ?? []),\n ]);\n },\n\n /**\n * Write the document as UTF-8 chunks.\n * @param snapshot - the snapshot\n * @param options - the common options\n * @returns the chunks\n */\n export(snapshot: GraphSnapshot, options?: CxExportOptions & ExporterStyleOptions): AsyncIterable<Uint8Array> {\n return encodeChunks(written(snapshot, options));\n },\n\n /**\n * Write the document as one string.\n * @param snapshot - the snapshot\n * @param options - the common options\n * @returns the document\n */\n exportToString(snapshot: GraphSnapshot, options?: CxExportOptions & ExporterStyleOptions): Promise<string> {\n return joinText(written(snapshot, options));\n },\n});\n\n/**\n * The document's text, with the styles when they are given.\n * @param snapshot - the snapshot\n * @param options - the options\n * @returns the text parts\n */\nfunction written(\n snapshot: GraphSnapshot,\n options: (CxExportOptions & ExporterStyleOptions) | undefined,\n): Generator<string, void, undefined> {\n const styled = cytoscapeStyledExport(snapshot, options?.styles, \"desktop\");\n const target = styled?.snapshot ?? snapshot;\n return write(target, plan(target, resolveExportOptions(options)), styled?.styled ?? null);\n}\n"],"names":["plan","i","written"],"mappings":";;;;;;;;;;AA0DA,MAAM,YAAY;AAaX,MAAM,UAAU,OAAO,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,EAKjC,wBAAwB;AAAA;AAAA,EAExB,gBAAgB;AAAA;AAAA,EAEhB,iBAAiB,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAKtB,kBAAkB,KAAK;AAAA;AAAA,EAEvB,kBAAkB,KAAK;AAAA;AAAA,EAEvB,cAAc,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA,EAKnB,cAAc,KAAK;AAAA;AAAA;AAAA;AAAA;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W,QAAQ,OAAO;AACtB,UAAM,GAAG,IAAI;AAAA,EACjB;AACJ;AAMO,MAAM,aAA6C,OAAO,OAAO;AAAA,EACpE,QAAQ;AAAA,EACR,SAAS,OAAO,OAAO,EAAE;AAAA,EACzB,cAAc;AAAA,EACd,QAAQ,OAAO,OAAO,EAAE,cAAc,uBAAuB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQ7D,MAAM,UAAyB,SAAuE;AAClG,UAAM,SAAS,sBAAsB,UAAU,SAAS,QAAQ,SAAS;AACzE,WAAO,OAAO,OAAO;AAAA,MACjB,GAAG,KAAK,QAAQ,YAAY,UAAU,qBAAqB,OAAO,CAAC,EAAE;AAAA,MACrE,GAAI,QAAQ,SAAS,CAAA;AAAA,IAAC,CACzB;AAAA,EACL;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,OAAO,UAAyB,SAA6E;AACzG,WAAO,aAAa,QAAQ,UAAU,OAAO,CAAC;AAAA,EAClD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,eAAe,UAAyB,SAAmE;AACvG,WAAO,SAAS,QAAQ,UAAU,OAAO,CAAC;AAAA,EAC9C;AACJ,CAAC;AAQD,SAAS,QACL,UACA,SACkC;AAClC,QAAM,SAAS,sBAAsB,UAAU,SAAS,QAAQ,SAAS;AACzE,QAAM,SAAS,QAAQ,YAAY;AACnC,SAAO,MAAM,QAAQ,KAAK,QAAQ,qBAAqB,OAAO,CAAC,GAAG,QAAQ,UAAU,IAAI;AAC5F;"}
|
|
1
|
+
{"version":3,"file":"exporter-CA5q8ROP.js","sources":["../../src/formats/cx/exporter.ts"],"sourcesContent":["/**\n * The CX version 1 exporter (design/graph-io/cytoscape-and-obo/design.md section 1.2): writes a\n * snapshot as the NDEx form of a CX document -- one network with at most one view, no\n * `cySubNetworks` -- which NDEx, ndex2 and Cytoscape's CX import all read.\n *\n * Aspects, in the order Cytoscape and NDEx write them: `numberVerification`, the pre-`metaData`\n * (element counts, `idCounter` on nodes, edges, citations and supports), `nodes` (`n` the label,\n * `r` the `represents` column), `edges` (`i` the `interaction` column), `nodeAttributes`,\n * `edgeAttributes` and `networkAttributes` (values as JSON strings, the spec's form), `cyTableColumn`\n * (so a column no element fills is still declared), `cartesianLayout` (y negated back to screen\n * coordinates), `cyGroups` from the parent / parents column, `cyVisualProperties` from the\n * `cx.bypass` columns, the provenance aspects a CX import created, the style rules and unknown\n * aspects a CX import kept, and `status`.\n *\n * Given styles (`exportGraph(..., { styles })`), `cyVisualProperties` holds the Cytoscape style of the rules\n * (`network`, `nodes:default` and `edges:default` with their mappings and dependencies) and a bypass for every\n * element whose value the style cannot give, and the style values the rules read are attributes. The\n * `graphty.styles` block, which graph-io hands over as a graph attribute, is written as an aspect of its own\n * (a kept one is written back the same way).\n *\n * What CX cannot hold is announced by check() before anything is written: every edge is directed\n * (W_CX_UNDIRECTED_AS_DIRECTED, W_MUTUAL_EXPANDED), node ids are integers (E_ID_CHARSET unless\n * `sanitizeIds: \"mangle\"`, which keeps the original in the `graphty:originalId` attribute the\n * importer restores), nested values are written as JSON text (W_CX_JSON_AS_STRING), and the generic\n * notes of checkCapabilities(). NaN and the infinities are written as \"NaN\" / \"Infinity\" in double\n * attributes, which read back as they were.\n */\n\nimport { type Column, GraphFormatError, type GraphSnapshot, type NodeId } from \"@graphty/graph-format\";\n\nimport { childrenCsr } from \"../../children.js\";\nimport {\n aspectBlock,\n type CxNoteFn,\n declaredType,\n directionNotes,\n nextNodeId,\n noteList,\n planEdgeIds,\n planNodeIds,\n stringify,\n type WrittenIds,\n} from \"../../common/cx-export.js\";\nimport { type PairFolding, pairFolding } from \"../../common/direction.js\";\nimport { capabilities, checkCapabilities, LOSS } from \"../../common/export.js\";\nimport { isRecord, POSITION_COLUMN } from \"../../common/json-elements.js\";\nimport { type ResolvedExportOptions, resolveExportOptions } from \"../../common/options.js\";\nimport { plural } from \"../../common/plural.js\";\nimport { type ExplicitWeights, explicitWeights } from \"../../common/weights.js\";\nimport { encodeChunks, joinText } from \"../../common/writer.js\";\nimport { cytoscapeCxAspect, type CytoscapeEmitted } from \"../../styles/cytoscape/emit.js\";\nimport { STYLE_BLOCK_NAME } from \"../../styles/io/block.js\";\nimport type { ExporterStyleOptions } from \"../../styles/io/writer.js\";\nimport { type CommonExportOptions, type ExportCapabilities, type GraphExporter, type LossNote } from \"../../types.js\";\nimport { ORIGINAL_ID_ATTRIBUTE } from \"../cx2/importer.js\";\nimport { blockAspect, CX_STYLE_CAPABILITIES, cytoscapeStyledExport, snapshotBlock } from \"./styles.js\";\n\n/** The format name. */\nconst CX_FORMAT = \"cx\";\n\n/**\n * The options of the CX exporter: the common export options; it has none of its own.\n * @category Built-in formats\n */\nexport type CxExportOptions = CommonExportOptions;\n\n/**\n * The loss notes the CX exporter's check() returns, by name. A key is the code without its\n * severity and format prefixes.\n * @category Built-in formats\n */\nexport const CX_LOSS = Object.freeze({\n /**\n * Every edge is written as directed, so an undirected graph, or the undirected edges of a mixed graph, read back\n * as directed.\n */\n UNDIRECTED_AS_DIRECTED: \"W_CX_UNDIRECTED_AS_DIRECTED\",\n /** A nested (json) column is written as a string attribute holding its JSON text. */\n JSON_AS_STRING: \"W_CX_JSON_AS_STRING\",\n /** A mutual pair is written as two directed edges without its mark. */\n MUTUAL_EXPANDED: LOSS.MUTUAL_EXPANDED,\n /**\n * An attribute named `weight` without the weight role reads back as the edge weight, or is not written when the\n * graph has weights of its own.\n */\n WEIGHT_KEY_CLASH: LOSS.WEIGHT_KEY_CLASH,\n /** A start / end / timestamp column: CX has no time. */\n TEMPORAL_DROPPED: LOSS.TEMPORAL,\n /** An attribute with a role the format has no place for is written as a plain attribute; the role is lost. */\n ROLE_DROPPED: LOSS.ROLE,\n /**\n * An attribute without a role is written where the format keeps a role (for example, a `name` column as the label), and\n * reads back with that role.\n */\n ROLE_ASSUMED: LOSS.ROLE_ASSUMED,\n /**\n * An attribute type CX stores as another (a 32-bit float as double, an unsigned integer as long, a byte as\n * integer, a dictionary as string); it reads back with that type.\n */\n DTYPE_UNSUPPORTED: LOSS.DTYPE,\n /** A multi-component column (a second view's `position@2`, a vector) is written as a list of doubles. */\n COMPONENTS_FLATTENED: LOSS.COMPONENTS,\n /** A declared default: CX has none. */\n DEFAULT_DROPPED: LOSS.DEFAULT,\n /** Declared options: CX has no enumerations. */\n OPTIONS_DROPPED: LOSS.OPTIONS,\n /**\n * Node ids the format cannot write, under `sanitizeIds: \"error\"`; the save fails with E_INVALID_ID. Pass\n * `sanitizeIds: \"mangle\"` to rewrite them.\n */\n ID_CHARSET: LOSS.ID_CHARSET,\n /** Node ids that are not integers under sanitizeIds \"mangle\": renumbered, originals kept. */\n ID_MANGLED: LOSS.ID_MANGLED,\n /** Edges without a usable integer id get generated ids. */\n EDGE_IDS_GENERATED: LOSS.EDGE_IDS_GENERATED,\n /**\n * An attribute with a role (for example, the label) is written where the format keeps that role, and reads back under the\n * name the format's importer gives it.\n */\n COLUMN_NAME_CHANGED: LOSS.COLUMN_NAME_CHANGED,\n /** An extension table other than the `cx:citations` / `cx:supports` tables a CX import creates. */\n EXTENSION_TABLE_DROPPED: LOSS.EXTENSION_TABLE,\n /** A position, stacking order or weight that is NaN or infinite: CX spells no such number there. */\n NONFINITE_AS_NULL: LOSS.NONFINITE_AS_NULL,\n /** Visual columns (color, size, shape, thickness roles): CX keeps style as visual properties, not roles. */\n VIZ_DROPPED: LOSS.VIZ,\n});\n\n/**\n * What CX version 1 keeps: directed multigraphs with self-loops, integer node ids, required\n * integer edge ids, typed string / double / integer / boolean attributes and lists of them, network\n * attributes, the position role (one view), and containment as `cyGroups`. f32, u32, u8 and dict\n * columns are written as the nearest declared type and read back as it.\n * @category Built-in formats\n */\nexport const CX_CAPABILITIES: ExportCapabilities = capabilities({\n mixedDirection: false,\n multiEdges: true,\n selfLoops: true,\n edgeIds: \"required\",\n idCharset: \"integer\",\n dtypes: [\"string\", \"f64\", \"i32\", \"bool\"],\n components: false,\n lists: true,\n json: false,\n defaults: false,\n options: false,\n hierarchy: true,\n temporal: \"none\",\n graphAttributes: true,\n positions: true,\n viz: false,\n});\n\n/** The roles CX has a slot for, and the column names its importer gives them. */\nconst SLOT_ROLES: ReadonlySet<string> = new Set([\"label\", \"position\", \"id\"]);\nconst ROLE_NAMES: Readonly<Record<string, string>> = Object.freeze({\n label: \"name\",\n position: POSITION_COLUMN,\n id: \"id\",\n parent: \"parent\",\n});\n\n/** Roles whose columns are never written as attributes. */\nconst SKIPPED_ROLES: ReadonlySet<string> = new Set([\n \"directed\",\n \"pair\",\n \"mutual\",\n \"weight\",\n \"timeText\",\n \"originalId\",\n \"parent\",\n \"parents\",\n \"start\",\n \"end\",\n \"timestamp\",\n \"timestamps\",\n \"spells\",\n \"open\",\n \"spellsOpen\",\n \"position\",\n \"color\",\n \"size\",\n \"shape\",\n \"thickness\",\n \"id\",\n]);\n\n/** The origin namespace of the per-element visual property columns of a CX import. */\nconst BYPASS_NAMESPACE = \"cx.bypass\";\n\n/** The extension tables a CX import creates from the citations and supports aspects. */\nconst PROVENANCE_TABLES: Readonly<Record<string, string>> = Object.freeze({\n \"cx:citations\": \"citations\",\n \"cx:supports\": \"supports\",\n});\n\n/**\n * Kept aspects never written back: they describe the collection, views and SUIDs of the file the\n * snapshot came from, or are written by the exporter itself.\n */\nconst NEVER_WRITTEN: ReadonlySet<string> = new Set([\n \"nodes\",\n \"edges\",\n \"nodeAttributes\",\n \"edgeAttributes\",\n \"networkAttributes\",\n \"cartesianLayout\",\n \"cyGroups\",\n \"cyVisualProperties\",\n \"cyTableColumn\",\n \"cySubNetworks\",\n \"cyNetworkRelations\",\n \"cyViews\",\n \"CX Element ID\",\n \"citations\",\n \"supports\",\n \"nodeCitations\",\n \"edgeCitations\",\n \"nodeSupports\",\n \"edgeSupports\",\n \"functionTerms\",\n \"reifiedEdges\",\n \"numberVerification\",\n \"metaData\",\n \"status\",\n \"groups\",\n \"subnetwork\",\n STYLE_BLOCK_NAME,\n]);\n\n/** The weight attribute name (the CX importer's weightFrom default). */\nconst WEIGHT_ATTRIBUTE = \"weight\";\n\n/** The dtypes a plain `weight` column may have to be written as the weight. */\nconst NUMERIC_DTYPES: ReadonlySet<string> = new Set([\"f32\", \"f64\", \"i32\", \"u32\", \"u8\"]);\n\n/** One attribute column as it will be written. */\ninterface AttributePlan {\n readonly column: Column;\n /** The attribute name written in n. */\n readonly name: string;\n /** The declared type text. */\n readonly d: string;\n}\n\n/** A core field (n, r, i) and the column it comes from. */\ninterface CorePlan {\n readonly key: \"n\" | \"r\" | \"i\";\n readonly column: Column;\n}\n\n/** The edge weights as written: explicit weights or a plain numeric `weight` column. */\ninterface WeightPlan {\n /**\n * The weight of an edge, or undefined when none is written.\n * @param e - the edge index\n * @returns the value\n */\n value(e: number): number | undefined;\n}\n\n/** Everything export() and check() need, computed once. */\ninterface Plan {\n readonly notes: LossNote[];\n readonly fatal: GraphFormatError | null;\n readonly ids: WrittenIds | null;\n readonly folding: PairFolding;\n readonly edgeIds: readonly number[];\n readonly weight: WeightPlan | null;\n readonly nodeCore: readonly CorePlan[];\n readonly edgeCore: readonly CorePlan[];\n readonly nodeAttrs: readonly AttributePlan[];\n readonly edgeAttrs: readonly AttributePlan[];\n readonly graphAttrs: readonly AttributePlan[];\n readonly position: Column | null;\n readonly positionZ: boolean;\n readonly z: Column | null;\n readonly bypass: {\n readonly node: readonly Column[];\n readonly edge: readonly Column[];\n readonly graph: readonly Column[];\n };\n readonly collapsed: Column | null;\n readonly links: readonly LinkPlan[];\n readonly functionTerm: Column | null;\n readonly reifiedEdge: Column | null;\n}\n\n/** A citations / supports list column and the aspect it is written to. */\ninterface LinkPlan {\n readonly aspect: string;\n readonly key: \"citations\" | \"supports\";\n readonly domain: \"node\" | \"edge\";\n readonly column: Column;\n}\n\n/**\n * Whether a column was created by the CX importer in an origin namespace.\n * @param column - the column\n * @param namespace - the namespace\n * @returns true when it was\n */\nfunction fromCx(column: Column, namespace: string): boolean {\n return column.meta.origin?.format === CX_FORMAT && column.meta.origin.namespace === namespace;\n}\n\n/**\n * Whether a column is a bypass column of a CX import.\n * @param column - the column\n * @returns true for the cx.bypass namespace\n */\nfunction isBypass(column: Column): boolean {\n return column.meta.origin?.namespace === BYPASS_NAMESPACE;\n}\n\n/**\n * Whether a column is the z (stacking order) column.\n * @param column - the column\n * @returns true for the column marked by a Cytoscape-family importer\n */\nfunction isZ(column: Column): boolean {\n return column.meta.extra.cytoscape === \"z\";\n}\n\n/**\n * Whether a column is a provenance list column (citations / supports) of a CX import.\n * @param column - the column\n * @returns true for one\n */\nfunction isLink(column: Column): boolean {\n return (\n fromCx(column, \"provenance\") &&\n column.meta.dtype === \"list\" &&\n (column.meta.name === \"citations\" || column.meta.name === \"supports\")\n );\n}\n\n/**\n * Whether a column holds a text the core fields (n, r, i) cannot hold as itself.\n * @param column - the column\n * @returns true for every dtype but string (dict and json have their own notes)\n */\nfunction coreNeedsText(column: Column): boolean {\n const { dtype } = column.meta;\n return dtype !== \"string\" && dtype !== \"dict\" && dtype !== \"json\";\n}\n\n/**\n * The notes of checkCapabilities(), adapted to CX: json columns are written as JSON text, the id\n * notes are counted by planNodeIds(), the provenance tables and columns a CX import made are\n * written back.\n * @param snapshot - the snapshot\n * @param common - the resolved common options\n * @param several - whether the parents column gives some node several parents\n * @param own - the functionTerm and reifiedEdge columns written as their own aspects\n * @param notes - the notes so far\n * @param note - records a note\n * @returns the error export() throws for mixed direction, or null\n */\nfunction genericNotes(\n snapshot: GraphSnapshot,\n common: ResolvedExportOptions,\n several: boolean,\n own: readonly (Column | null)[],\n notes: LossNote[],\n note: CxNoteFn,\n): GraphFormatError | null {\n let fatal: GraphFormatError | null = null;\n const edgeLabel = snapshot.edges.byRole(\"label\")?.meta.name;\n const ownNames = new Set(own.filter((c): c is Column => c !== null).map((c) => c.meta.name));\n for (const gen of checkCapabilities(snapshot, CX_CAPABILITIES, common, {\n roles: SLOT_ROLES,\n // a parents column reads back as parents only when some node has several parents\n roleNames: several ? { ...ROLE_NAMES, parents: \"parents\" } : ROLE_NAMES,\n })) {\n if (writtenOtherwise(gen, ownNames)) {\n continue;\n }\n if (gen.code === LOSS.JSON) {\n const which = gen.column === null ? \"a column\" : `column \"${gen.column}\"`;\n note(\n CX_LOSS.JSON_AS_STRING,\n `${which} holds nested values; written as a string attribute holding their JSON text`,\n gen.column,\n gen.count,\n );\n continue;\n }\n if (isEdgeLabelRename(gen, edgeLabel)) {\n // only nodes have a label slot (n); an edge label is a plain attribute\n note(\n LOSS.ROLE,\n `edge column \"${edgeLabel ?? \"\"}\" (label) is written as a plain attribute; CX edges have no label slot and the role is lost`,\n gen.column,\n gen.count,\n );\n continue;\n }\n if (gen.code === LOSS.MIXED_DIRECTION_ERROR && fatal === null) {\n fatal = new GraphFormatError(\"E_DIRECTED\", gen.message, { reason: \"mixed direction\" });\n }\n notes.push(gen);\n }\n if (edgeLabel === \"name\") {\n note(\n LOSS.ROLE,\n `edge column \"name\" (label) is written as a plain attribute; CX edges have no label slot and the role is lost`,\n \"name\",\n null,\n );\n }\n return fatal;\n}\n\n/**\n * Whether a generic note is about something CX writes another way: the functionTerm and\n * reifiedEdge columns (their own aspects), ids (counted by planNodeIds(), since CX also keeps\n * integer ids beyond 2^53, which the generic rule refuses) and the provenance tables.\n * @param gen - the generic note\n * @param ownNames - the names of the columns written as their own aspects\n * @returns true when the note does not apply\n */\nfunction writtenOtherwise(gen: LossNote, ownNames: ReadonlySet<string>): boolean {\n if (gen.column !== null && ownNames.has(gen.column) && (gen.code === LOSS.JSON || gen.code === LOSS.DTYPE)) {\n return true;\n }\n if (gen.code === LOSS.ID_CHARSET || gen.code === LOSS.ID_MANGLED) {\n return true;\n }\n return gen.code === LOSS.EXTENSION_TABLE && gen.column !== null && gen.column in PROVENANCE_TABLES;\n}\n\n/**\n * Whether a generic note is the rename of the edge label column.\n * @param gen - the generic note\n * @param edgeLabel - the edge label column's name, if any\n * @returns true when it is\n */\nfunction isEdgeLabelRename(gen: LossNote, edgeLabel: string | undefined): boolean {\n return gen.code === LOSS.COLUMN_NAME_CHANGED && gen.column === edgeLabel && gen.message.startsWith(\"edge column\");\n}\n\n/**\n * The node positions to write: the position column, the z column (when it fits the layout), whether\n * the position's third coordinate is written as z, and the count of non-finite values left out.\n * @param snapshot - the snapshot\n * @param note - records a note\n * @returns the position plan\n */\nfunction planPositions(\n snapshot: GraphSnapshot,\n note: CxNoteFn,\n): { position: Column | null; z: Column | null; positionZ: boolean; nonfinite: number } {\n const position = snapshot.nodes.byRole(\"position\");\n const zColumn = [...snapshot.nodes].find(isZ) ?? null;\n const z = zColumn !== null && zFitsLayout(zColumn, position) ? zColumn : null;\n if (position === null) {\n return { position, z, positionZ: false, nonfinite: 0 };\n }\n let nonfinite = nonFiniteCells(position, (v) => [v[0], v[1]]);\n const depth = nonFiniteCells(position, (v) => (v[2] === 0 ? [] : [Number.NaN]));\n const positionZ = zColumn === null && (position.meta.extra.sourceDims === 3 || depth > 0);\n if (positionZ) {\n nonfinite += nonFiniteCells(position, (v) => (Number.isFinite(v[0]) && Number.isFinite(v[1]) ? [v[2]] : []));\n note(\n LOSS.COMPONENTS,\n `node column \"${position.meta.name}\" (position) has a third coordinate; CX writes it as the layout's z, which reads back in the z column (a stacking order), not in the position`,\n position.meta.name,\n depth,\n );\n }\n return { position, z, positionZ, nonfinite };\n}\n\n/**\n * Note the graph columns that read back as the graph's name or description.\n * @param snapshot - the snapshot\n * @param note - records a note\n */\nfunction graphColumnNotes(snapshot: GraphSnapshot, note: CxNoteFn): void {\n for (const c of snapshot.graph) {\n const named = c.meta.name === \"name\" || c.meta.name === \"description\";\n if (!isBypass(c) && named && (c.dtype === \"string\" || c.dtype === \"dict\")) {\n note(\n LOSS.ROLE_ASSUMED,\n `graph column \"${c.meta.name}\" is written as the network attribute ${c.meta.name}, which reads back as the graph's ${c.meta.name}, not as a column`,\n c.meta.name,\n null,\n );\n }\n }\n}\n\n/**\n * Plan an export: the notes, the fatal condition and what is written.\n * @param snapshot - the snapshot\n * @param common - the resolved common options\n * @returns the plan\n */\nfunction plan(snapshot: GraphSnapshot, common: ResolvedExportOptions): Plan {\n const { notes, note } = noteList();\n const functionTerm =\n [...snapshot.nodes].find((c) => fromCx(c, \"provenance\") && c.meta.name === \"functionTerm\") ?? null;\n const reifiedEdge = [...snapshot.nodes].find((c) => fromCx(c, \"reifiedEdges\") && c.dtype === \"u32\") ?? null;\n const children = childrenCsr(snapshot);\n const several = children.column?.meta.role === \"parents\" && severalParents(children.column);\n let fatal = genericNotes(snapshot, common, several, [functionTerm, reifiedEdge], notes, note);\n\n const folding = pairFolding(snapshot);\n directionNotes(snapshot, folding, common, CX_LOSS.UNDIRECTED_AS_DIRECTED, note);\n const planned = planNodeIds(snapshot, common, \"CX\", ORIGINAL_ID_ATTRIBUTE, note);\n const ids = planned instanceof GraphFormatError ? null : planned;\n if (planned instanceof GraphFormatError) {\n fatal ??= planned;\n }\n const edgeIds = planEdgeIds(snapshot, note, ids);\n if (snapshot.nodes.has(ORIGINAL_ID_ATTRIBUTE)) {\n note(\n LOSS.ROLE_ASSUMED,\n `node column \"${ORIGINAL_ID_ATTRIBUTE}\" is the importer's record of mangled ids: it reads back as the node ids unless restoreMangledIds is false`,\n ORIGINAL_ID_ATTRIBUTE,\n null,\n );\n }\n\n // nodes: n, r, the z column, the groups' collapsed flags, provenance\n const positions = planPositions(snapshot, note);\n const { position, z, positionZ } = positions;\n let { nonfinite } = positions;\n const collapsed = [...snapshot.nodes].find((c) => fromCx(c, \"cyGroups\") && c.dtype === \"bool\") ?? null;\n const nodeCore = corePlans(snapshot, note);\n const edgeCore: CorePlan[] = [];\n const interaction = snapshot.edges.get(\"interaction\");\n if (interaction !== null && (interaction.meta.role === null || !SKIPPED_ROLES.has(interaction.meta.role))) {\n edgeCore.push({ key: \"i\", column: interaction });\n coreTextNote(interaction, \"edge\", note);\n }\n\n const coreColumns = new Set<Column>([...nodeCore, ...edgeCore].map((c) => c.column));\n const special = (c: Column): boolean =>\n coreColumns.has(c) ||\n isBypass(c) ||\n isLink(c) ||\n c === z ||\n c === collapsed ||\n c === functionTerm ||\n c === reifiedEdge ||\n (c.meta.role !== null && SKIPPED_ROLES.has(c.meta.role));\n\n const label = snapshot.nodes.byRole(\"label\");\n const renamedName = label !== null && label.meta.name !== \"name\" ? snapshot.nodes.get(\"name\") : null;\n if (renamedName !== null) {\n note(\n LOSS.COLUMN_NAME_CHANGED,\n `node column \"name\" is written as the attribute \"name#2\" and reads back as \"name#2\", because the label column \"${label?.meta.name ?? \"\"}\" is written as n and takes the name \"name\"`,\n \"name\",\n renamedName.length - renamedName.nullCount,\n );\n }\n const nodeAttrs = attributePlans(snapshot.nodes, special, (c) => (c === renamedName ? \"name#2\" : c.meta.name));\n\n const weight = planWeight(snapshot, folding, note);\n const plainWeight = snapshot.edges.get(WEIGHT_ATTRIBUTE);\n const edgeAttrs = attributePlans(\n snapshot.edges,\n (c) => special(c) || (c === plainWeight && c.meta.role === null),\n (c) => c.meta.name,\n );\n nonfinite += weight.nonfinite;\n\n graphColumnNotes(snapshot, note);\n // the graphty.styles block is an aspect of its own\n const graphAttrs = attributePlans(\n snapshot.graph,\n (c) => isBypass(c) || c.meta.name === STYLE_BLOCK_NAME,\n (c) => c.meta.name,\n );\n\n if (children.column !== null && children.column.meta.role === \"parents\" && !several) {\n note(\n LOSS.COLUMN_NAME_CHANGED,\n `node column \"${children.column.meta.name}\" (parents) holds at most one parent per node; it reads back as the single-parent column \"parent\"`,\n children.column.meta.name,\n children.column.length - children.column.nullCount,\n );\n }\n\n if (nonfinite > 0) {\n note(\n LOSS.NONFINITE_AS_NULL,\n `${nonfinite} NaN or infinite position${plural(nonfinite)}, stacking orders or weights cannot be written in CX; they read back unset`,\n null,\n nonfinite,\n );\n }\n return {\n notes,\n fatal,\n ids,\n folding,\n edgeIds,\n weight: weight.plan,\n nodeCore,\n edgeCore,\n nodeAttrs,\n edgeAttrs,\n graphAttrs,\n position,\n positionZ,\n z,\n bypass: {\n node: [...snapshot.nodes].filter(isBypass),\n edge: [...snapshot.edges].filter(isBypass),\n graph: [...snapshot.graph].filter(isBypass),\n },\n collapsed,\n links: linkPlans(snapshot),\n functionTerm,\n reifiedEdge,\n };\n}\n\n/**\n * The node core fields: n from the label column (else a plain `name` column, which then reads back\n * as the label), r from a `represents` column.\n * @param snapshot - the snapshot\n * @param note - records a note\n * @returns the plans\n */\nfunction corePlans(snapshot: GraphSnapshot, note: CxNoteFn): CorePlan[] {\n const out: CorePlan[] = [];\n const label = snapshot.nodes.byRole(\"label\");\n const plainName = snapshot.nodes.get(\"name\");\n const n = label ?? (plainName !== null && plainName.meta.role === null ? plainName : null);\n if (n !== null) {\n out.push({ key: \"n\", column: n });\n coreTextNote(n, \"node\", note);\n if (n !== label) {\n note(\n LOSS.ROLE_ASSUMED,\n `node column \"name\" is written as n and reads back as the label`,\n \"name\",\n n.length - n.nullCount,\n );\n }\n }\n const represents = snapshot.nodes.get(\"represents\");\n if (\n represents !== null &&\n represents !== n &&\n (represents.meta.role === null || !SKIPPED_ROLES.has(represents.meta.role))\n ) {\n out.push({ key: \"r\", column: represents });\n coreTextNote(represents, \"node\", note);\n }\n return out;\n}\n\n/**\n * The note of a core field column that is not text: n, r and i are strings in CX.\n * @param column - the column\n * @param domain - node or edge\n * @param note - records a note\n */\nfunction coreTextNote(column: Column, domain: string, note: CxNoteFn): void {\n if (coreNeedsText(column)) {\n note(\n LOSS.DTYPE,\n `${domain} column \"${column.meta.name}\" is ${column.dtype}; CX writes it as text and it reads back as string`,\n column.meta.name,\n column.length - column.nullCount,\n );\n }\n}\n\n/**\n * The attribute plans of one table.\n * @param table - the table\n * @param skip - columns not written as attributes\n * @param rename - the written name of a column\n * @returns the plans\n */\nfunction attributePlans(\n table: Iterable<Column>,\n skip: (column: Column) => boolean,\n rename: (column: Column) => string,\n): AttributePlan[] {\n return [...table]\n .filter((c) => !skip(c))\n .map((column) => ({ column, name: rename(column), d: declaredType(column) }));\n}\n\n/**\n * The weights to write: the explicit weights, else a plain numeric `weight` column (which then\n * reads back as THE weight); a plain `weight` column that is not written is noted.\n * @param snapshot - the snapshot\n * @param folding - the pair folding\n * @param note - records a note\n * @returns the plan, or null for no weight attribute, and the count of non-finite weights skipped\n */\nfunction planWeight(\n snapshot: GraphSnapshot,\n folding: PairFolding,\n note: CxNoteFn,\n): { plan: WeightPlan | null; nonfinite: number } {\n const weights: ExplicitWeights = explicitWeights(snapshot);\n const plain = snapshot.edges.get(WEIGHT_ATTRIBUTE);\n const clash = plain !== null && plain.meta.role === null;\n let plan: WeightPlan | null = null;\n if (weights.weighted) {\n plan = { value: (e) => (weights.isExplicit(e) ? weights.value(e) : undefined) };\n if (clash) {\n note(\n LOSS.WEIGHT_KEY_CLASH,\n `edge column \"${WEIGHT_ATTRIBUTE}\" is not written: the explicit weights are written under that name`,\n WEIGHT_ATTRIBUTE,\n null,\n );\n }\n } else if (clash) {\n const numeric = NUMERIC_DTYPES.has(plain.dtype);\n note(\n LOSS.WEIGHT_KEY_CLASH,\n numeric\n ? `edge column \"${WEIGHT_ATTRIBUTE}\" is written as the weight attribute and reads back as the edge weight`\n : `edge column \"${WEIGHT_ATTRIBUTE}\" is ${plain.dtype}, and CX reads that attribute as the edge weight; it is not written`,\n WEIGHT_ATTRIBUTE,\n null,\n );\n if (numeric) {\n plan = { value: (e) => (plain.isSet(e) ? (plain.value(e) as number) : undefined) };\n }\n }\n return { plan, nonfinite: plan === null ? 0 : nanWeights(snapshot.edgeCount, plan, folding) };\n}\n\n/**\n * The written weights that are NaN, which is not a weight on re-import (the infinities are).\n * @param edgeCount - the number of edges\n * @param plan - the weight plan\n * @param folding - the pair folding\n * @returns the count\n */\nfunction nanWeights(edgeCount: number, plan: WeightPlan, folding: PairFolding): number {\n let nan = 0;\n for (let e = 0; e < edgeCount; e++) {\n const w = plan.value(e);\n if (!folding.folded(e) && w !== undefined && Number.isNaN(w)) {\n nan++;\n }\n }\n return nan;\n}\n\n/**\n * Whether the z column can go into cartesianLayout: every set z is finite and its node has a\n * finite position (a layout entry needs x and y). Otherwise it is written as an ordinary attribute.\n * @param z - the z column\n * @param position - the position column\n * @returns true when every z fits a layout entry\n */\nfunction zFitsLayout(z: Column, position: Column | null): boolean {\n for (let i = 0; i < z.length; i++) {\n if (!z.isSet(i)) {\n continue;\n }\n const value = z.value(i);\n const point = position?.isSet(i) === true ? (position.value(i) as ArrayLike<number>) : null;\n if (\n typeof value !== \"number\" ||\n !Number.isFinite(value) ||\n point === null ||\n !Number.isFinite(point[0]) ||\n !Number.isFinite(point[1])\n ) {\n return false;\n }\n }\n return true;\n}\n\n/**\n * Count the set cells of a multi-component column with a non-finite component among those picked.\n * @param column - the column\n * @param pick - the components that are written\n * @returns the count\n */\nfunction nonFiniteCells(column: Column, pick: (value: ArrayLike<number>) => number[]): number {\n let count = 0;\n for (let i = 0; i < column.length; i++) {\n if (column.isSet(i) && pick(column.value(i) as ArrayLike<number>).some((v) => !Number.isFinite(v))) {\n count++;\n }\n }\n return count;\n}\n\n/**\n * Whether a parents column gives some node more than one parent.\n * @param column - the parents list column\n * @returns true when one does\n */\nfunction severalParents(column: Column): boolean {\n for (let i = 0; i < column.length; i++) {\n if (column.isSet(i) && (column.value(i) as ArrayLike<unknown>).length > 1) {\n return true;\n }\n }\n return false;\n}\n\n/**\n * The citations / supports list columns of a CX import and the aspects they go to.\n * @param snapshot - the snapshot\n * @returns the plans\n */\nfunction linkPlans(snapshot: GraphSnapshot): LinkPlan[] {\n const out: LinkPlan[] = [];\n for (const [domain, table] of [\n [\"node\", snapshot.nodes],\n [\"edge\", snapshot.edges],\n ] as const) {\n for (const column of table) {\n if (isLink(column)) {\n const key = column.meta.name as \"citations\" | \"supports\";\n out.push({ aspect: `${domain}${key === \"citations\" ? \"Citations\" : \"Supports\"}`, key, domain, column });\n }\n }\n }\n return out;\n}\n\n// ============================================================ writing\n\n/**\n * The text of a scalar the way Cytoscape writes CX values: numbers by their shortest decimal\n * (\"-0\", \"NaN\", \"Infinity\" included), booleans as \"true\" / \"false\".\n * @param value - the value\n * @returns the text\n */\nfunction scalarText(value: unknown): string {\n if (typeof value === \"number\") {\n return Object.is(value, -0) ? \"-0\" : String(value);\n }\n if (typeof value === \"string\") {\n return value;\n }\n return typeof value === \"boolean\" ? String(value) : JSON.stringify(value);\n}\n\n/**\n * The v of one cell: a JSON string, or an array of strings for a list type.\n * @param column - the column\n * @param d - its declared type\n * @param row - the row\n * @returns the value, or undefined for an unset cell\n */\nfunction cellValue(column: Column, d: string, row: number): unknown {\n if (!column.isSet(row)) {\n return undefined;\n }\n const value = column.value(row);\n if (column.meta.dtype === \"json\") {\n return JSON.stringify(value);\n }\n if (column.meta.dtype === \"list\" || column.meta.components > 1) {\n const items = Array.from(value as ArrayLike<unknown>);\n return d === \"string\" ? JSON.stringify(items) : items.map(scalarText);\n }\n return scalarText(value);\n}\n\n/**\n * The text a core field (n, r, i) holds for one row.\n * @param column - the column\n * @param row - the row\n * @returns the text, or undefined for an unset cell\n */\nfunction coreText(column: Column, row: number): string | undefined {\n if (!column.isSet(row)) {\n return undefined;\n }\n const value = column.value(row);\n if (column.meta.dtype === \"json\" || column.meta.dtype === \"list\" || column.meta.components > 1) {\n return JSON.stringify(column.meta.dtype === \"json\" ? value : Array.from(value as ArrayLike<unknown>));\n }\n return scalarText(value);\n}\n\n/** One aspect to write: its name, its elements (produced twice: once to count them) and its idCounter. */\ninterface Aspect {\n readonly name: string;\n readonly elements: () => Iterable<unknown>;\n readonly idCounter?: NodeId | undefined;\n}\n\n/**\n * The written edges: every logical edge but the folded halves of pairs.\n * @param snapshot - the snapshot\n * @param folding - the pair folding\n * @returns the edge indexes\n */\nfunction writtenEdges(snapshot: GraphSnapshot, folding: PairFolding): number[] {\n const out: number[] = [];\n for (let e = 0; e < snapshot.edgeCount; e++) {\n if (!folding.folded(e)) {\n out.push(e);\n }\n }\n return out;\n}\n\n/**\n * Build every aspect of the document, in the order Cytoscape and NDEx write them.\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param ids - the written node ids\n * @param styled - the styles as a Cytoscape style, or null without styles\n * @returns the aspects (those without elements included; the writer skips them)\n */\nfunction aspects(snapshot: GraphSnapshot, p: Plan, ids: WrittenIds, styled: CytoscapeEmitted | null): Aspect[] {\n const { src, dst } = snapshot.edgeList();\n const edges = writtenEdges(snapshot, p.folding);\n const nodeRange = (): number[] => Array.from({ length: snapshot.nodeCount }, (_, i) => i);\n const nodeCore = (key: \"n\" | \"r\"): Column | null => p.nodeCore.find((c) => c.key === key)?.column ?? null;\n const n = nodeCore(\"n\");\n const r = nodeCore(\"r\");\n const i = p.edgeCore[0]?.column ?? null;\n const kept =\n snapshot.meta.sourceFormat === CX_FORMAT && isRecord(snapshot.meta.extra.cx) ? snapshot.meta.extra.cx : {};\n\n const out: Aspect[] = [\n {\n name: \"nodes\",\n idCounter: nextNodeId(ids, snapshot.nodeCount),\n *elements() {\n for (let row = 0; row < snapshot.nodeCount; row++) {\n const element: Record<string, unknown> = { \"@id\": ids.idAt(row) };\n const name = n === null ? undefined : coreText(n, row);\n const represents = r === null ? undefined : coreText(r, row);\n if (name !== undefined) {\n element.n = name;\n }\n if (represents !== undefined) {\n element.r = represents;\n }\n yield element;\n }\n },\n },\n {\n name: \"edges\",\n idCounter: edges.reduce((max, e) => Math.max(max, p.edgeIds[e] + 1), 0),\n *elements() {\n for (const e of edges) {\n const element: Record<string, unknown> = {\n \"@id\": p.edgeIds[e],\n s: ids.idAt(src[e]),\n t: ids.idAt(dst[e]),\n };\n const interaction = i === null ? undefined : coreText(i, e);\n if (interaction !== undefined) {\n element.i = interaction;\n }\n yield element;\n }\n },\n },\n {\n name: \"nodeAttributes\",\n *elements() {\n for (const a of p.nodeAttrs) {\n for (let row = 0; row < snapshot.nodeCount; row++) {\n const v = cellValue(a.column, a.d, row);\n if (v !== undefined) {\n yield { po: ids.idAt(row), n: a.name, v, d: a.d };\n }\n }\n }\n for (let row = 0; row < snapshot.nodeCount; row++) {\n if (ids.isChanged(row)) {\n yield {\n po: ids.idAt(row),\n n: ORIGINAL_ID_ATTRIBUTE,\n v: String(ids.originalAt(row)),\n d: \"string\",\n };\n }\n }\n },\n },\n {\n name: \"edgeAttributes\",\n *elements() {\n for (const a of p.edgeAttrs) {\n for (const e of edges) {\n const v = cellValue(a.column, a.d, e);\n if (v !== undefined) {\n yield { po: p.edgeIds[e], n: a.name, v, d: a.d };\n }\n }\n }\n if (p.weight !== null) {\n for (const e of edges) {\n const w = p.weight.value(e);\n if (w !== undefined && !Number.isNaN(w)) {\n yield { po: p.edgeIds[e], n: WEIGHT_ATTRIBUTE, v: scalarText(w), d: \"double\" };\n }\n }\n }\n },\n },\n {\n name: \"networkAttributes\",\n *elements() {\n for (const a of p.graphAttrs) {\n const v = cellValue(a.column, a.d, 0);\n if (v !== undefined) {\n yield { n: a.name, v, d: a.d };\n }\n }\n const { meta } = snapshot;\n for (const [key, value] of [\n [\"name\", meta.name],\n [\"description\", meta.description],\n ] as const) {\n if (value !== null && !p.graphAttrs.some((a) => a.name === key)) {\n yield { n: key, v: value, d: \"string\" };\n }\n }\n },\n },\n { name: \"cyTableColumn\", elements: () => tableColumns(p, ids) },\n { name: \"cartesianLayout\", elements: () => layoutElements(p, ids, nodeRange()) },\n { name: \"cyGroups\", elements: () => groupElements(snapshot, p, ids, edges) },\n {\n name: \"cyVisualProperties\",\n elements: () =>\n styled === null\n ? visualProperties(p, ids, nodeRange(), edges, kept)\n : styledVisualProperties(styled, ids, p.edgeIds, edges),\n },\n ];\n const block = snapshotBlock(snapshot);\n if (block !== null) {\n out.push({ name: STYLE_BLOCK_NAME, elements: () => blockAspect(block) });\n }\n out.push(...provenanceAspects(snapshot, p, ids, edges));\n for (const [name, value] of Object.entries(kept)) {\n if (!NEVER_WRITTEN.has(name) && Array.isArray(value)) {\n out.push({ name, elements: () => keptElements(value, kept.subnetwork, STYLE_ASPECTS.has(name)) });\n }\n }\n return out;\n}\n\n/**\n * The cyTableColumn entries: every written column with its type, so a column no element fills is\n * still declared on re-import.\n * @param p - the plan\n * @param ids - the written ids\n * @yields the entries\n */\nfunction* tableColumns(p: Plan, ids: WrittenIds): Generator<unknown, void, undefined> {\n for (const { key, column } of [...p.nodeCore, ...p.edgeCore]) {\n const n = { n: \"name\", r: \"represents\", i: \"interaction\" }[key];\n if (n !== undefined && column !== null) {\n yield { applies_to: key === \"i\" ? \"edge_table\" : \"node_table\", n, d: \"string\" };\n }\n }\n for (const a of p.nodeAttrs) {\n yield { applies_to: \"node_table\", n: a.name, d: a.d };\n }\n if (ids.changed > 0) {\n yield { applies_to: \"node_table\", n: ORIGINAL_ID_ATTRIBUTE, d: \"string\" };\n }\n for (const a of p.edgeAttrs) {\n yield { applies_to: \"edge_table\", n: a.name, d: a.d };\n }\n if (p.weight !== null) {\n yield { applies_to: \"edge_table\", n: WEIGHT_ATTRIBUTE, d: \"double\" };\n }\n for (const a of p.graphAttrs) {\n yield { applies_to: \"network_table\", n: a.name, d: a.d };\n }\n}\n\n/** Kept aspects whose view references are rewritten to the one view of the written file. */\nconst STYLE_ASPECTS: ReadonlySet<string> = new Set([\"tableVisualProperties\", \"cyTableVisualProperties\"]);\n\n/**\n * The elements of a kept aspect: those of the snapshot's own subnetwork (or unscoped), with the\n * scope dropped; style elements get their view references rewritten to view 0.\n * @param elements - the kept elements\n * @param subnetwork - the subnetwork the snapshot was read from, if any\n * @param style - whether the aspect is a style aspect\n * @yields the elements to write\n */\nfunction* keptElements(\n elements: readonly unknown[],\n subnetwork: unknown,\n style: boolean,\n): Generator<unknown, void, undefined> {\n for (const element of elements) {\n if (!isRecord(element)) {\n yield element;\n continue;\n }\n if (element.s !== undefined && element.s !== null && element.s !== subnetwork) {\n continue;\n }\n const { s: _scope, ...rest } = element;\n yield style ? rewriteView(rest) : rest;\n }\n}\n\n/**\n * A style element with its view and subnetwork references rewritten to 0, the written network.\n * @param element - the element\n * @returns the rewritten element\n */\nfunction rewriteView(element: Record<string, unknown>): Record<string, unknown> {\n const out = { ...element };\n if (\"view\" in out) {\n out.view = 0;\n }\n if (typeof out.applies_to === \"number\") {\n out.applies_to = 0;\n }\n return out;\n}\n\n/**\n * The cartesianLayout entries: x / y (y negated back to screen coordinates) and z.\n * @param p - the plan\n * @param ids - the written ids\n * @param rows - every node row\n * @yields the entries\n */\nfunction* layoutElements(p: Plan, ids: WrittenIds, rows: readonly number[]): Generator<unknown, void, undefined> {\n const { position } = p;\n if (position === null) {\n return;\n }\n for (const row of rows) {\n if (!position.isSet(row)) {\n continue;\n }\n const point = position.value(row) as ArrayLike<number>;\n if (!Number.isFinite(point[0]) || !Number.isFinite(point[1])) {\n continue;\n }\n const entry: Record<string, unknown> = { node: ids.idAt(row), x: point[0], y: point[1] === 0 ? 0 : -point[1] };\n if (p.z?.isSet(row) === true) {\n entry.z = p.z.value(row);\n } else if (p.positionZ && Number.isFinite(point[2])) {\n entry.z = point[2];\n }\n yield entry;\n }\n}\n\n/**\n * The cyGroups entries: one per node that has members (or a collapsed flag), its members, and the\n * edges with both ends (internal) or one end (external) among them.\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param ids - the written ids\n * @param edges - the written edges\n * @yields the entries\n */\nfunction* groupElements(\n snapshot: GraphSnapshot,\n p: Plan,\n ids: WrittenIds,\n edges: readonly number[],\n): Generator<unknown, void, undefined> {\n const children = childrenCsr(snapshot);\n const groupsOf = new Map<number, number[]>();\n const groups: number[] = [];\n for (let g = 0; g < snapshot.nodeCount; g++) {\n const members = children.childrenOf(g);\n if (members.length > 0 || p.collapsed?.isSet(g) === true) {\n groups.push(g);\n }\n for (const c of members) {\n groupsOf.set(c, [...(groupsOf.get(c) ?? []), g]);\n }\n }\n if (groups.length === 0) {\n return;\n }\n const { internal, external } = groupEdges(snapshot, p, groupsOf, edges);\n const label = p.nodeCore.find((c) => c.key === \"n\")?.column ?? null;\n for (const g of groups) {\n const entry: Record<string, unknown> = { \"@id\": ids.idAt(g) };\n const name = label === null ? undefined : coreText(label, g);\n if (name !== undefined) {\n entry.n = name;\n }\n entry.nodes = Array.from(children.childrenOf(g), (c) => ids.idAt(c));\n entry.internal_edges = internal.get(g) ?? [];\n entry.external_edges = external.get(g) ?? [];\n if (p.collapsed?.isSet(g) === true) {\n entry.collapsed = p.collapsed.value(g);\n }\n yield entry;\n }\n}\n\n/**\n * The written edges of each group: internal (both ends among its members) and external (one end).\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param groupsOf - the groups each member node is in\n * @param edges - the written edges\n * @returns the edge ids by group\n */\nfunction groupEdges(\n snapshot: GraphSnapshot,\n p: Plan,\n groupsOf: ReadonlyMap<number, number[]>,\n edges: readonly number[],\n): { internal: Map<number, number[]>; external: Map<number, number[]> } {\n const internal = new Map<number, number[]>();\n const external = new Map<number, number[]>();\n const add = (table: Map<number, number[]>, g: number, id: number): void => {\n table.set(g, [...(table.get(g) ?? []), id]);\n };\n const { src, dst } = snapshot.edgeList();\n for (const e of edges) {\n const ofSource = groupsOf.get(src[e]) ?? [];\n const ofTarget = groupsOf.get(dst[e]) ?? [];\n for (const g of ofSource) {\n add(ofTarget.includes(g) ? internal : external, g, p.edgeIds[e]);\n }\n for (const g of ofTarget.filter((t) => !ofSource.includes(t))) {\n add(external, g, p.edgeIds[e]);\n }\n }\n return { internal, external };\n}\n\n/**\n * The visual property values of one row: property -> value text.\n * @param columns - the bypass columns\n * @param row - the row\n * @returns the properties, or null when none is set\n */\nfunction bypassValues(columns: readonly Column[], row: number): Record<string, string> | null {\n let out: Record<string, string> | null = null;\n for (const column of columns) {\n if (column.isSet(row)) {\n // the visual property's own name: a column renamed for a clash with an attribute keeps it in origin.id\n const property = column.meta.origin?.id;\n out ??= {};\n out[typeof property === \"string\" && property.length > 0 ? property : column.meta.name] = scalarText(\n column.value(row),\n );\n }\n }\n return out;\n}\n\n/**\n * The cyVisualProperties entries: the network values, the style rules a CX import kept (its own\n * view's, rewritten to view 0) and the per-element values.\n * @param p - the plan\n * @param ids - the written ids\n * @param rows - every node row\n * @param edges - the written edges\n * @param kept - meta.extra.cx of a CX import, else empty\n * @yields the entries\n */\nfunction* visualProperties(\n p: Plan,\n ids: WrittenIds,\n rows: readonly number[],\n edges: readonly number[],\n kept: Record<string, unknown>,\n): Generator<unknown, void, undefined> {\n const network = bypassValues(p.bypass.graph, 0);\n if (network !== null) {\n yield { properties_of: \"network\", properties: network };\n }\n const view = ownView(kept);\n for (const entry of Array.isArray(kept.cyVisualProperties) ? (kept.cyVisualProperties as unknown[]) : []) {\n if (\n isRecord(entry) &&\n ![\"nodes\", \"edges\", \"network\"].includes(String(entry.properties_of)) &&\n (view === null || entry.view === undefined || entry.view === null || entry.view === view)\n ) {\n yield rewriteView(entry);\n }\n }\n for (const row of rows) {\n const properties = bypassValues(p.bypass.node, row);\n if (properties !== null) {\n yield { properties_of: \"nodes\", applies_to: ids.idAt(row), properties };\n }\n }\n for (const e of edges) {\n const properties = bypassValues(p.bypass.edge, e);\n if (properties !== null) {\n yield { properties_of: \"edges\", applies_to: p.edgeIds[e], properties };\n }\n }\n}\n\n/**\n * The cyVisualProperties entries of a styled export: the style's defaults, mappings and dependencies, then every\n * element's bypasses (as text, Cytoscape's form).\n * @param styled - the styles as a Cytoscape style\n * @param ids - the written ids\n * @param edgeIds - the written edge ids\n * @param edges - the written edges\n * @yields the entries\n */\nfunction* styledVisualProperties(\n styled: CytoscapeEmitted,\n ids: WrittenIds,\n edgeIds: readonly number[],\n edges: readonly number[],\n): Generator<unknown, void, undefined> {\n yield* cytoscapeCxAspect(styled.style);\n const text = (m: ReadonlyMap<string, unknown>): Record<string, string> =>\n Object.fromEntries([...m].map(([k, v]) => [k, String(v)]));\n for (let row = 0; row < styled.bypasses.node.length; row++) {\n const m = styled.bypasses.node[row];\n if (m !== null && m.size > 0) {\n yield { properties_of: \"nodes\", applies_to: ids.idAt(row), properties: text(m) };\n }\n }\n for (const e of edges) {\n const m = styled.bypasses.edge[e];\n if (m !== null && m.size > 0) {\n yield { properties_of: \"edges\", applies_to: edgeIds[e], properties: text(m) };\n }\n }\n}\n\n/**\n * The view of the subnetwork a CX import read (the one its style rules belong to).\n * @param kept - meta.extra.cx\n * @returns the view id, or null when the file named none\n */\nfunction ownView(kept: Record<string, unknown>): unknown {\n const sub = kept.subnetwork;\n for (const r of Array.isArray(kept.cyNetworkRelations) ? (kept.cyNetworkRelations as unknown[]) : []) {\n if (isRecord(r) && r.r === \"view\" && (sub === undefined || r.p === sub)) {\n return r.c;\n }\n }\n for (const v of Array.isArray(kept.cyViews) ? (kept.cyViews as unknown[]) : []) {\n if (isRecord(v) && (sub === undefined || v.s === sub)) {\n return v[\"@id\"];\n }\n }\n return null;\n}\n\n/**\n * The provenance aspects a CX import turned into extension tables and columns, written back:\n * citations, supports, their node / edge links, functionTerms and reifiedEdges.\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param ids - the written ids\n * @param edges - the written edges\n * @returns the aspects\n */\nfunction provenanceAspects(snapshot: GraphSnapshot, p: Plan, ids: WrittenIds, edges: readonly number[]): Aspect[] {\n const out: Aspect[] = [];\n for (const [table, aspect] of Object.entries(PROVENANCE_TABLES)) {\n const ext = snapshot.extensions.get(table);\n if (ext === undefined) {\n continue;\n }\n const idColumn = ext.get(\"id\");\n const fields = [...ext].filter((c) => c !== idColumn);\n let max = -1;\n for (let row = 0; row < ext.rowCount; row++) {\n if (idColumn?.isSet(row) === true) {\n max = Math.max(max, Number(idColumn.value(row)));\n }\n }\n out.push({\n name: aspect,\n idCounter: max + 1,\n *elements() {\n for (let row = 0; row < ext.rowCount; row++) {\n const element: Record<string, unknown> = {};\n if (idColumn?.isSet(row) === true) {\n element[\"@id\"] = idColumn.value(row);\n }\n for (const field of fields) {\n if (field.isSet(row)) {\n element[field.meta.name] = field.value(row);\n }\n }\n yield element;\n }\n },\n });\n }\n for (const link of p.links) {\n out.push({\n name: link.aspect,\n *elements() {\n const rows = link.domain === \"node\" ? Array.from({ length: snapshot.nodeCount }, (_, i) => i) : edges;\n for (const row of rows) {\n if (link.column.isSet(row)) {\n const po = link.domain === \"node\" ? ids.idAt(row) : p.edgeIds[row];\n yield { po: [po], [link.key]: Array.from(link.column.value(row) as ArrayLike<unknown>) };\n }\n }\n },\n });\n }\n const terms = p.functionTerm;\n if (terms !== null) {\n out.push({\n name: \"functionTerms\",\n *elements() {\n for (let row = 0; row < snapshot.nodeCount; row++) {\n const term = terms.isSet(row) ? terms.value(row) : null;\n if (isRecord(term)) {\n yield { po: ids.idAt(row), ...term };\n }\n }\n },\n });\n }\n const reified = p.reifiedEdge;\n if (reified !== null) {\n out.push({\n name: \"reifiedEdges\",\n *elements() {\n for (let row = 0; row < snapshot.nodeCount; row++) {\n const edge = reified.isSet(row) ? (reified.value(row) as number) : -1;\n if (edge >= 0 && edge < snapshot.edgeCount) {\n yield { node: ids.idAt(row), edge: p.edgeIds[edge] };\n }\n }\n },\n });\n }\n return out;\n}\n\n/**\n * Write the document as text parts.\n * @param snapshot - the snapshot\n * @param p - the plan\n * @param styled - the styles as a Cytoscape style, or null without styles\n * @yields the document's text\n * @returns nothing\n */\nfunction* write(\n snapshot: GraphSnapshot,\n p: Plan,\n styled: CytoscapeEmitted | null = null,\n): Generator<string, void, undefined> {\n if (p.fatal !== null) {\n throw p.fatal;\n }\n const { ids } = p;\n if (ids === null) {\n throw new GraphFormatError(\"E_INVALID_ID\", \"node ids cannot be written as CX integers\", { reason: \"charset\" });\n }\n const all = aspects(snapshot, p, ids, styled);\n const written: { aspect: Aspect; count: number }[] = [];\n for (const aspect of all) {\n let count = 0;\n for (const _ of aspect.elements()) {\n count++;\n }\n if (count > 0 || aspect.name === \"nodes\") {\n written.push({ aspect, count });\n }\n }\n const metaData = written.map(({ aspect, count }) => ({\n name: aspect.name,\n version: \"1.0\",\n ...(aspect.idCounter === undefined ? {} : { idCounter: aspect.idCounter }),\n elementCount: count,\n consistencyGroup: 1,\n }));\n yield '[{\"numberVerification\":[{\"longNumber\":281474976710655}]},\\n';\n yield `{\"metaData\":${stringify(metaData)}},\\n`;\n for (const { aspect } of written) {\n yield* aspectBlock(aspect.name, mapIterable(aspect.elements(), stringify));\n }\n yield '{\"status\":[{\"error\":\"\",\"success\":true}]}]\\n';\n}\n\n/**\n * Map an iterable lazily.\n * @param items - the items\n * @param fn - the mapping\n * @yields the mapped items\n */\nfunction* mapIterable<T, U>(items: Iterable<T>, fn: (item: T) => U): Generator<U, void, undefined> {\n for (const item of items) {\n yield fn(item);\n }\n}\n\n/**\n * The CX version 1 exporter plugin.\n * @category Built-in formats\n */\nexport const cxExporter: GraphExporter<CxExportOptions> = Object.freeze({\n format: CX_FORMAT,\n options: Object.freeze([]),\n capabilities: CX_CAPABILITIES,\n styles: Object.freeze({ capabilities: CX_STYLE_CAPABILITIES }),\n\n /**\n * Pre-flight: what export() would lose, without writing anything.\n * @param snapshot - the snapshot\n * @param options - the common options\n * @returns the notes, empty when the export is exact\n */\n check(snapshot: GraphSnapshot, options?: CxExportOptions & ExporterStyleOptions): readonly LossNote[] {\n const styled = cytoscapeStyledExport(snapshot, options?.styles, \"desktop\");\n return Object.freeze([\n ...plan(styled?.snapshot ?? snapshot, resolveExportOptions(options)).notes,\n ...(styled?.notes ?? []),\n ]);\n },\n\n /**\n * Write the document as UTF-8 chunks.\n * @param snapshot - the snapshot\n * @param options - the common options\n * @returns the chunks\n */\n export(snapshot: GraphSnapshot, options?: CxExportOptions & ExporterStyleOptions): AsyncIterable<Uint8Array> {\n return encodeChunks(written(snapshot, options));\n },\n\n /**\n * Write the document as one string.\n * @param snapshot - the snapshot\n * @param options - the common options\n * @returns the document\n */\n exportToString(snapshot: GraphSnapshot, options?: CxExportOptions & ExporterStyleOptions): Promise<string> {\n return joinText(written(snapshot, options));\n },\n});\n\n/**\n * The document's text, with the styles when they are given.\n * @param snapshot - the snapshot\n * @param options - the options\n * @returns the text parts\n */\nfunction written(\n snapshot: GraphSnapshot,\n options: (CxExportOptions & ExporterStyleOptions) | undefined,\n): Generator<string, void, undefined> {\n const styled = cytoscapeStyledExport(snapshot, options?.styles, \"desktop\");\n const target = styled?.snapshot ?? snapshot;\n return write(target, plan(target, resolveExportOptions(options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