@graphty/graph-io 0.3.43 → 0.3.44
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-3Q4TsdTh.js +40 -0
- package/dist/chunks/approximations-3Q4TsdTh.js.map +1 -0
- package/dist/chunks/block-JQiwViEt.js +2777 -0
- package/dist/chunks/block-JQiwViEt.js.map +1 -0
- package/dist/chunks/{choose-DvpbdRuz.js → choose-BemygfH8.js} +3 -2
- package/dist/chunks/{choose-DvpbdRuz.js.map → choose-BemygfH8.js.map} +1 -1
- package/dist/chunks/{constants-fT3E8JYY.js → constants-BFUR_CtU.js} +6 -2
- package/dist/chunks/constants-BFUR_CtU.js.map +1 -0
- package/dist/chunks/convert-BcQ8_jMo.js +59 -0
- package/dist/chunks/convert-BcQ8_jMo.js.map +1 -0
- package/dist/chunks/emit-DCwFLts5.js +3456 -0
- package/dist/chunks/emit-DCwFLts5.js.map +1 -0
- package/dist/chunks/{escape-B62ZGM_a.js → escape-B1rMftd9.js} +43 -20
- package/dist/chunks/escape-B1rMftd9.js.map +1 -0
- package/dist/chunks/{export-rKLeGQMo.js → export-D7IGzTG4.js} +196 -792
- package/dist/chunks/export-D7IGzTG4.js.map +1 -0
- package/dist/chunks/{exporter-BWwEuOPT.js → exporter-BtnqYuuj.js} +22 -12
- package/dist/chunks/exporter-BtnqYuuj.js.map +1 -0
- package/dist/chunks/{exporter-yLxKBvLE.js → exporter-ChPyhBOv.js} +4 -3
- package/dist/chunks/{exporter-yLxKBvLE.js.map → exporter-ChPyhBOv.js.map} +1 -1
- package/dist/chunks/{exporter-8hLNemFk.js → exporter-KEPxYUXD.js} +133 -74
- package/dist/chunks/exporter-KEPxYUXD.js.map +1 -0
- package/dist/chunks/{exporter-RVtXVetw.js → exporter-quPUCBiC.js} +1805 -287
- package/dist/chunks/exporter-quPUCBiC.js.map +1 -0
- package/dist/chunks/format-GDmO6m6Q.js +676 -0
- package/dist/chunks/format-GDmO6m6Q.js.map +1 -0
- package/dist/chunks/generic-BL06jrJf.js +1347 -0
- package/dist/chunks/generic-BL06jrJf.js.map +1 -0
- package/dist/chunks/{importer-WrGRZb0N.js → importer-B7r2owVf.js} +449 -102
- package/dist/chunks/importer-B7r2owVf.js.map +1 -0
- package/dist/chunks/{importer-Ht7LNg8L.js → importer-BFmOP96W.js} +116 -296
- package/dist/chunks/importer-BFmOP96W.js.map +1 -0
- package/dist/chunks/{importer-BbNb7eNg.js → importer-C2nzGhdV.js} +1390 -129
- package/dist/chunks/importer-C2nzGhdV.js.map +1 -0
- package/dist/chunks/{importer-Dz7tI8Sa.js → importer-CbX2_rNF.js} +617 -115
- package/dist/chunks/importer-CbX2_rNF.js.map +1 -0
- package/dist/chunks/{importer-D794XUTe.js → importer-CdzeN6X4.js} +31 -8
- package/dist/chunks/importer-CdzeN6X4.js.map +1 -0
- package/dist/chunks/{importer-xZ-3suY1.js → importer-ChKNC_GN.js} +791 -135
- package/dist/chunks/importer-ChKNC_GN.js.map +1 -0
- package/dist/chunks/{importer-C98dpSH4.js → importer-dwoYpSqb.js} +141 -82
- package/dist/chunks/importer-dwoYpSqb.js.map +1 -0
- package/dist/chunks/index-B9fdNpTA.js +4310 -0
- package/dist/chunks/index-B9fdNpTA.js.map +1 -0
- package/dist/chunks/{json-elements-DKSqpNW1.js → json-elements-C4FwgnH5.js} +123 -32
- package/dist/chunks/json-elements-C4FwgnH5.js.map +1 -0
- package/dist/chunks/lexicon-B-knUi-l.js +508 -0
- package/dist/chunks/lexicon-B-knUi-l.js.map +1 -0
- package/dist/chunks/{ontology-export-CtRXjg_i.js → ontology-export-BSpbY5FL.js} +3 -2
- package/dist/chunks/{ontology-export-CtRXjg_i.js.map → ontology-export-BSpbY5FL.js.map} +1 -1
- package/dist/chunks/{records-Cu4bxYOm.js → records-Nwz_rbNt.js} +2 -2
- package/dist/chunks/{records-Cu4bxYOm.js.map → records-Nwz_rbNt.js.map} +1 -1
- package/dist/chunks/styles-Brt9JMfs.js +690 -0
- package/dist/chunks/styles-Brt9JMfs.js.map +1 -0
- package/dist/chunks/styles-_N-C8S-U.js +2102 -0
- package/dist/chunks/styles-_N-C8S-U.js.map +1 -0
- package/dist/chunks/styles-yed-DAfcIkf7.js +842 -0
- package/dist/chunks/styles-yed-DAfcIkf7.js.map +1 -0
- package/dist/chunks/{text-DHOJXnED.js → text-CgzMqHQb.js} +2 -2
- package/dist/chunks/{text-DHOJXnED.js.map → text-CgzMqHQb.js.map} +1 -1
- package/dist/chunks/units-XMZFIFe1.js +19 -0
- package/dist/chunks/units-XMZFIFe1.js.map +1 -0
- package/dist/csv.js +5 -4
- package/dist/csv.js.map +1 -1
- package/dist/cx.js +1 -1
- package/dist/cx2.js +2 -2
- package/dist/cys.js +1 -1
- package/dist/dot.js +5 -2
- package/dist/dot.js.map +1 -1
- package/dist/gexf.js +292 -412
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +8 -3031
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +354 -240
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +4 -2
- package/dist/graphml.js.map +1 -1
- package/dist/json.js +1 -1
- package/dist/neo4j.js +4 -3
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +4 -2
- package/dist/positions.d.ts +1 -0
- package/dist/positions.js +427 -0
- package/dist/positions.js.map +1 -0
- package/dist/src/common/codes.d.ts +6 -0
- package/dist/src/common/codes.d.ts.map +1 -1
- package/dist/src/common/codes.js +6 -0
- package/dist/src/common/codes.js.map +1 -1
- package/dist/src/common/escape.d.ts.map +1 -1
- package/dist/src/common/escape.js +4 -2
- package/dist/src/common/escape.js.map +1 -1
- package/dist/src/common/export.d.ts +10 -0
- package/dist/src/common/export.d.ts.map +1 -1
- package/dist/src/common/export.js +123 -100
- package/dist/src/common/export.js.map +1 -1
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +8 -1
- package/dist/src/common/input.js.map +1 -1
- package/dist/src/common/json-elements.d.ts +12 -9
- package/dist/src/common/json-elements.d.ts.map +1 -1
- package/dist/src/common/json-elements.js +160 -37
- package/dist/src/common/json-elements.js.map +1 -1
- package/dist/src/common/notes.d.ts +42 -0
- package/dist/src/common/notes.d.ts.map +1 -0
- package/dist/src/common/notes.js +72 -0
- package/dist/src/common/notes.js.map +1 -0
- package/dist/src/common/report.d.ts +18 -0
- package/dist/src/common/report.d.ts.map +1 -1
- package/dist/src/common/report.js +36 -1
- package/dist/src/common/report.js.map +1 -1
- package/dist/src/common/units.d.ts +24 -0
- package/dist/src/common/units.d.ts.map +1 -0
- package/dist/src/common/units.js +26 -0
- package/dist/src/common/units.js.map +1 -0
- package/dist/src/common/xml.d.ts +18 -0
- package/dist/src/common/xml.d.ts.map +1 -1
- package/dist/src/common/xml.js +42 -5
- package/dist/src/common/xml.js.map +1 -1
- package/dist/src/formats/cx/exporter.d.ts +6 -0
- package/dist/src/formats/cx/exporter.d.ts.map +1 -1
- package/dist/src/formats/cx/exporter.js +71 -8
- package/dist/src/formats/cx/exporter.js.map +1 -1
- package/dist/src/formats/cx/importer.d.ts +5 -2
- package/dist/src/formats/cx/importer.d.ts.map +1 -1
- package/dist/src/formats/cx/importer.js +102 -72
- package/dist/src/formats/cx/importer.js.map +1 -1
- package/dist/src/formats/cx/styles.d.ts +102 -0
- package/dist/src/formats/cx/styles.d.ts.map +1 -0
- package/dist/src/formats/cx/styles.js +225 -0
- package/dist/src/formats/cx/styles.js.map +1 -0
- package/dist/src/formats/cx2/exporter.d.ts +5 -0
- package/dist/src/formats/cx2/exporter.d.ts.map +1 -1
- package/dist/src/formats/cx2/exporter.js +181 -71
- package/dist/src/formats/cx2/exporter.js.map +1 -1
- package/dist/src/formats/cx2/importer.d.ts +4 -1
- package/dist/src/formats/cx2/importer.d.ts.map +1 -1
- package/dist/src/formats/cx2/importer.js +19 -1
- package/dist/src/formats/cx2/importer.js.map +1 -1
- package/dist/src/formats/cx2/styles.d.ts +18 -0
- package/dist/src/formats/cx2/styles.d.ts.map +1 -0
- package/dist/src/formats/cx2/styles.js +24 -0
- package/dist/src/formats/cx2/styles.js.map +1 -0
- package/dist/src/formats/cys/constants.d.ts +2 -0
- package/dist/src/formats/cys/constants.d.ts.map +1 -1
- package/dist/src/formats/cys/constants.js +2 -0
- package/dist/src/formats/cys/constants.js.map +1 -1
- package/dist/src/formats/cys/exporter.d.ts +6 -2
- package/dist/src/formats/cys/exporter.d.ts.map +1 -1
- package/dist/src/formats/cys/exporter.js +215 -53
- package/dist/src/formats/cys/exporter.js.map +1 -1
- package/dist/src/formats/cys/importer.d.ts +2 -1
- package/dist/src/formats/cys/importer.d.ts.map +1 -1
- package/dist/src/formats/cys/importer.js +119 -6
- package/dist/src/formats/cys/importer.js.map +1 -1
- package/dist/src/formats/cys/session.d.ts +2 -0
- package/dist/src/formats/cys/session.d.ts.map +1 -1
- package/dist/src/formats/cys/session.js +5 -0
- package/dist/src/formats/cys/session.js.map +1 -1
- package/dist/src/formats/cys/styles.d.ts +38 -0
- package/dist/src/formats/cys/styles.d.ts.map +1 -0
- package/dist/src/formats/cys/styles.js +213 -0
- package/dist/src/formats/cys/styles.js.map +1 -0
- package/dist/src/formats/cys/tables.d.ts +8 -3
- package/dist/src/formats/cys/tables.d.ts.map +1 -1
- package/dist/src/formats/cys/tables.js +88 -34
- package/dist/src/formats/cys/tables.js.map +1 -1
- package/dist/src/formats/dot/exporter.d.ts +2 -0
- package/dist/src/formats/dot/exporter.d.ts.map +1 -1
- package/dist/src/formats/dot/exporter.js +195 -81
- package/dist/src/formats/dot/exporter.js.map +1 -1
- package/dist/src/formats/dot/importer.d.ts.map +1 -1
- package/dist/src/formats/dot/importer.js +100 -20
- package/dist/src/formats/dot/importer.js.map +1 -1
- package/dist/src/formats/dot/index.d.ts +1 -0
- package/dist/src/formats/dot/index.d.ts.map +1 -1
- package/dist/src/formats/dot/index.js +1 -0
- package/dist/src/formats/dot/index.js.map +1 -1
- package/dist/src/formats/dot/positions.d.ts +14 -0
- package/dist/src/formats/dot/positions.d.ts.map +1 -0
- package/dist/src/formats/dot/positions.js +70 -0
- package/dist/src/formats/dot/positions.js.map +1 -0
- package/dist/src/formats/dot/styles.d.ts +82 -0
- package/dist/src/formats/dot/styles.d.ts.map +1 -0
- package/dist/src/formats/dot/styles.js +1484 -0
- package/dist/src/formats/dot/styles.js.map +1 -0
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
- package/dist/src/formats/gexf/exporter.js +20 -5
- package/dist/src/formats/gexf/exporter.js.map +1 -1
- package/dist/src/formats/gexf/importer.d.ts +8 -1
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +251 -131
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gexf/index.d.ts +8 -0
- package/dist/src/formats/gexf/index.d.ts.map +1 -1
- package/dist/src/formats/gexf/index.js +10 -2
- package/dist/src/formats/gexf/index.js.map +1 -1
- package/dist/src/formats/gexf/schema.d.ts +5 -0
- package/dist/src/formats/gexf/schema.d.ts.map +1 -1
- package/dist/src/formats/gexf/schema.js +5 -0
- package/dist/src/formats/gexf/schema.js.map +1 -1
- package/dist/src/formats/gexf/styles.d.ts +74 -0
- package/dist/src/formats/gexf/styles.d.ts.map +1 -0
- package/dist/src/formats/gexf/styles.js +604 -0
- package/dist/src/formats/gexf/styles.js.map +1 -0
- package/dist/src/formats/gml/exporter.d.ts +1 -5
- package/dist/src/formats/gml/exporter.d.ts.map +1 -1
- package/dist/src/formats/gml/exporter.js +19 -8
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/gml/importer.d.ts.map +1 -1
- package/dist/src/formats/gml/importer.js +4 -0
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/index.d.ts +2 -1
- package/dist/src/formats/gml/index.d.ts.map +1 -1
- package/dist/src/formats/gml/index.js +2 -1
- package/dist/src/formats/gml/index.js.map +1 -1
- package/dist/src/formats/gml/positions.d.ts +14 -0
- package/dist/src/formats/gml/positions.d.ts.map +1 -0
- package/dist/src/formats/gml/positions.js +46 -0
- package/dist/src/formats/gml/positions.js.map +1 -0
- package/dist/src/formats/gml/styles.d.ts +59 -0
- package/dist/src/formats/gml/styles.d.ts.map +1 -0
- package/dist/src/formats/gml/styles.js +1056 -0
- package/dist/src/formats/gml/styles.js.map +1 -0
- package/dist/src/formats/gml/syntax.d.ts +11 -0
- package/dist/src/formats/gml/syntax.d.ts.map +1 -1
- package/dist/src/formats/gml/syntax.js +151 -62
- package/dist/src/formats/gml/syntax.js.map +1 -1
- package/dist/src/formats/graphml/constants.d.ts +4 -0
- package/dist/src/formats/graphml/constants.d.ts.map +1 -1
- package/dist/src/formats/graphml/constants.js +5 -1
- package/dist/src/formats/graphml/constants.js.map +1 -1
- package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
- package/dist/src/formats/graphml/exporter.js +133 -65
- package/dist/src/formats/graphml/exporter.js.map +1 -1
- package/dist/src/formats/graphml/importer.d.ts +4 -1
- package/dist/src/formats/graphml/importer.d.ts.map +1 -1
- package/dist/src/formats/graphml/importer.js +100 -44
- package/dist/src/formats/graphml/importer.js.map +1 -1
- package/dist/src/formats/graphml/index.d.ts +1 -0
- package/dist/src/formats/graphml/index.d.ts.map +1 -1
- package/dist/src/formats/graphml/index.js +1 -0
- package/dist/src/formats/graphml/index.js.map +1 -1
- package/dist/src/formats/graphml/styles-plain.d.ts +19 -0
- package/dist/src/formats/graphml/styles-plain.d.ts.map +1 -0
- package/dist/src/formats/graphml/styles-plain.js +187 -0
- package/dist/src/formats/graphml/styles-plain.js.map +1 -0
- package/dist/src/formats/graphml/styles-yed.d.ts +179 -0
- package/dist/src/formats/graphml/styles-yed.d.ts.map +1 -0
- package/dist/src/formats/graphml/styles-yed.js +1086 -0
- package/dist/src/formats/graphml/styles-yed.js.map +1 -0
- package/dist/src/formats/graphml/styles-yfiles3.d.ts +19 -0
- package/dist/src/formats/graphml/styles-yfiles3.d.ts.map +1 -0
- package/dist/src/formats/graphml/styles-yfiles3.js +508 -0
- package/dist/src/formats/graphml/styles-yfiles3.js.map +1 -0
- package/dist/src/formats/graphml/tree.d.ts.map +1 -1
- package/dist/src/formats/graphml/tree.js +34 -19
- package/dist/src/formats/graphml/tree.js.map +1 -1
- package/dist/src/formats/graphml/yfiles.d.ts +16 -2
- package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
- package/dist/src/formats/graphml/yfiles.js +83 -12
- package/dist/src/formats/graphml/yfiles.js.map +1 -1
- package/dist/src/formats/json/exporter.d.ts +5 -0
- package/dist/src/formats/json/exporter.d.ts.map +1 -1
- package/dist/src/formats/json/exporter.js +68 -25
- package/dist/src/formats/json/exporter.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts +22 -3
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +439 -264
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/positions.d.ts +16 -0
- package/dist/src/formats/json/positions.d.ts.map +1 -0
- package/dist/src/formats/json/positions.js +44 -0
- package/dist/src/formats/json/positions.js.map +1 -0
- package/dist/src/formats/json/styles.d.ts +102 -0
- package/dist/src/formats/json/styles.d.ts.map +1 -0
- package/dist/src/formats/json/styles.js +1753 -0
- package/dist/src/formats/json/styles.js.map +1 -0
- package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
- package/dist/src/formats/neo4j/exporter.js +2 -1
- package/dist/src/formats/neo4j/exporter.js.map +1 -1
- package/dist/src/formats/pajek/exporter.d.ts +2 -0
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +142 -76
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.d.ts +4 -0
- package/dist/src/formats/pajek/importer.d.ts.map +1 -1
- package/dist/src/formats/pajek/importer.js +60 -6
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/index.d.ts +2 -0
- package/dist/src/formats/pajek/index.d.ts.map +1 -1
- package/dist/src/formats/pajek/index.js +2 -0
- package/dist/src/formats/pajek/index.js.map +1 -1
- package/dist/src/formats/pajek/styles.d.ts +50 -0
- package/dist/src/formats/pajek/styles.d.ts.map +1 -0
- package/dist/src/formats/pajek/styles.js +569 -0
- package/dist/src/formats/pajek/styles.js.map +1 -0
- package/dist/src/formats/pajek/syntax.d.ts +6 -0
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +6 -0
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/columns.d.ts.map +1 -1
- package/dist/src/formats/xgmml/columns.js +34 -9
- package/dist/src/formats/xgmml/columns.js.map +1 -1
- package/dist/src/formats/xgmml/constants.d.ts +2 -0
- package/dist/src/formats/xgmml/constants.d.ts.map +1 -1
- package/dist/src/formats/xgmml/constants.js +3 -1
- package/dist/src/formats/xgmml/constants.js.map +1 -1
- package/dist/src/formats/xgmml/document.d.ts +12 -8
- package/dist/src/formats/xgmml/document.d.ts.map +1 -1
- package/dist/src/formats/xgmml/document.js +56 -13
- package/dist/src/formats/xgmml/document.js.map +1 -1
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
- package/dist/src/formats/xgmml/emit.js +12 -6
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/exporter.d.ts +3 -1
- package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
- package/dist/src/formats/xgmml/exporter.js +22 -9
- package/dist/src/formats/xgmml/exporter.js.map +1 -1
- package/dist/src/formats/xgmml/importer.d.ts +2 -1
- package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
- package/dist/src/formats/xgmml/importer.js +31 -24
- package/dist/src/formats/xgmml/importer.js.map +1 -1
- package/dist/src/formats/xgmml/styles.d.ts +104 -0
- package/dist/src/formats/xgmml/styles.d.ts.map +1 -0
- package/dist/src/formats/xgmml/styles.js +310 -0
- package/dist/src/formats/xgmml/styles.js.map +1 -0
- package/dist/src/index.d.ts +9 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -7
- package/dist/src/index.js.map +1 -1
- package/dist/src/positions/codes.d.ts +31 -0
- package/dist/src/positions/codes.d.ts.map +1 -0
- package/dist/src/positions/codes.js +26 -0
- package/dist/src/positions/codes.js.map +1 -0
- package/dist/src/positions/convert.d.ts +58 -0
- package/dist/src/positions/convert.d.ts.map +1 -0
- package/dist/src/positions/convert.js +107 -0
- package/dist/src/positions/convert.js.map +1 -0
- package/dist/src/positions/extract.d.ts +27 -0
- package/dist/src/positions/extract.d.ts.map +1 -0
- package/dist/src/positions/extract.js +526 -0
- package/dist/src/positions/extract.js.map +1 -0
- package/dist/src/positions/index.d.ts +10 -0
- package/dist/src/positions/index.d.ts.map +1 -0
- package/dist/src/positions/index.js +9 -0
- package/dist/src/positions/index.js.map +1 -0
- package/dist/src/positions/types.d.ts +208 -0
- package/dist/src/positions/types.d.ts.map +1 -0
- package/dist/src/positions/types.js +10 -0
- package/dist/src/positions/types.js.map +1 -0
- package/dist/src/registry.d.ts +30 -0
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +130 -9
- package/dist/src/registry.js.map +1 -1
- package/dist/src/styles/annotations.d.ts +132 -0
- package/dist/src/styles/annotations.d.ts.map +1 -0
- package/dist/src/styles/annotations.js +320 -0
- package/dist/src/styles/annotations.js.map +1 -0
- package/dist/src/styles/budget.d.ts +45 -0
- package/dist/src/styles/budget.d.ts.map +1 -0
- package/dist/src/styles/budget.js +58 -0
- package/dist/src/styles/budget.js.map +1 -0
- package/dist/src/styles/canon/bends.d.ts +32 -0
- package/dist/src/styles/canon/bends.d.ts.map +1 -0
- package/dist/src/styles/canon/bends.js +74 -0
- package/dist/src/styles/canon/bends.js.map +1 -0
- package/dist/src/styles/canon/color-tables.d.ts +22 -0
- package/dist/src/styles/canon/color-tables.d.ts.map +1 -0
- package/dist/src/styles/canon/color-tables.js +369 -0
- package/dist/src/styles/canon/color-tables.js.map +1 -0
- package/dist/src/styles/canon/color.d.ts +66 -0
- package/dist/src/styles/canon/color.d.ts.map +1 -0
- package/dist/src/styles/canon/color.js +548 -0
- package/dist/src/styles/canon/color.js.map +1 -0
- package/dist/src/styles/canon/enums.d.ts +25 -0
- package/dist/src/styles/canon/enums.d.ts.map +1 -0
- package/dist/src/styles/canon/enums.js +187 -0
- package/dist/src/styles/canon/enums.js.map +1 -0
- package/dist/src/styles/canon/graphviz.d.ts +48 -0
- package/dist/src/styles/canon/graphviz.d.ts.map +1 -0
- package/dist/src/styles/canon/graphviz.js +160 -0
- package/dist/src/styles/canon/graphviz.js.map +1 -0
- package/dist/src/styles/canon/index.d.ts +13 -0
- package/dist/src/styles/canon/index.d.ts.map +1 -0
- package/dist/src/styles/canon/index.js +13 -0
- package/dist/src/styles/canon/index.js.map +1 -0
- package/dist/src/styles/canon/number.d.ts +59 -0
- package/dist/src/styles/canon/number.d.ts.map +1 -0
- package/dist/src/styles/canon/number.js +142 -0
- package/dist/src/styles/canon/number.js.map +1 -0
- package/dist/src/styles/canon/site.d.ts +51 -0
- package/dist/src/styles/canon/site.d.ts.map +1 -0
- package/dist/src/styles/canon/site.js +63 -0
- package/dist/src/styles/canon/site.js.map +1 -0
- package/dist/src/styles/canon/text.d.ts +61 -0
- package/dist/src/styles/canon/text.d.ts.map +1 -0
- package/dist/src/styles/canon/text.js +199 -0
- package/dist/src/styles/canon/text.js.map +1 -0
- package/dist/src/styles/codes.d.ts +95 -0
- package/dist/src/styles/codes.d.ts.map +1 -0
- package/dist/src/styles/codes.js +97 -0
- package/dist/src/styles/codes.js.map +1 -0
- package/dist/src/styles/cyjs/cascade.d.ts +134 -0
- package/dist/src/styles/cyjs/cascade.d.ts.map +1 -0
- package/dist/src/styles/cyjs/cascade.js +2252 -0
- package/dist/src/styles/cyjs/cascade.js.map +1 -0
- package/dist/src/styles/cyjs/defaults-table.d.ts +25 -0
- package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -0
- package/dist/src/styles/cyjs/defaults-table.js +76 -0
- package/dist/src/styles/cyjs/defaults-table.js.map +1 -0
- package/dist/src/styles/cyjs/emit.d.ts +82 -0
- package/dist/src/styles/cyjs/emit.d.ts.map +1 -0
- package/dist/src/styles/cyjs/emit.js +790 -0
- package/dist/src/styles/cyjs/emit.js.map +1 -0
- package/dist/src/styles/cyjs/index.d.ts +13 -0
- package/dist/src/styles/cyjs/index.d.ts.map +1 -0
- package/dist/src/styles/cyjs/index.js +13 -0
- package/dist/src/styles/cyjs/index.js.map +1 -0
- package/dist/src/styles/cyjs/live.d.ts +46 -0
- package/dist/src/styles/cyjs/live.d.ts.map +1 -0
- package/dist/src/styles/cyjs/live.js +108 -0
- package/dist/src/styles/cyjs/live.js.map +1 -0
- package/dist/src/styles/cyjs/mappers.d.ts +147 -0
- package/dist/src/styles/cyjs/mappers.d.ts.map +1 -0
- package/dist/src/styles/cyjs/mappers.js +744 -0
- package/dist/src/styles/cyjs/mappers.js.map +1 -0
- package/dist/src/styles/cyjs/selector.d.ts +113 -0
- package/dist/src/styles/cyjs/selector.d.ts.map +1 -0
- package/dist/src/styles/cyjs/selector.js +611 -0
- package/dist/src/styles/cyjs/selector.js.map +1 -0
- package/dist/src/styles/cyjs/stylesheet-text.d.ts +37 -0
- package/dist/src/styles/cyjs/stylesheet-text.d.ts.map +1 -0
- package/dist/src/styles/cyjs/stylesheet-text.js +181 -0
- package/dist/src/styles/cyjs/stylesheet-text.js.map +1 -0
- package/dist/src/styles/cytoscape/emit.d.ts +125 -0
- package/dist/src/styles/cytoscape/emit.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/emit.js +1025 -0
- package/dist/src/styles/cytoscape/emit.js.map +1 -0
- package/dist/src/styles/cytoscape/index.d.ts +10 -0
- package/dist/src/styles/cytoscape/index.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/index.js +10 -0
- package/dist/src/styles/cytoscape/index.js.map +1 -0
- package/dist/src/styles/cytoscape/lexicon.d.ts +49 -0
- package/dist/src/styles/cytoscape/lexicon.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/lexicon.js +603 -0
- package/dist/src/styles/cytoscape/lexicon.js.map +1 -0
- package/dist/src/styles/cytoscape/mappings.d.ts +171 -0
- package/dist/src/styles/cytoscape/mappings.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/mappings.js +460 -0
- package/dist/src/styles/cytoscape/mappings.js.map +1 -0
- package/dist/src/styles/cytoscape/resolve.d.ts +137 -0
- package/dist/src/styles/cytoscape/resolve.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/resolve.js +381 -0
- package/dist/src/styles/cytoscape/resolve.js.map +1 -0
- package/dist/src/styles/cytoscape/translate.d.ts +50 -0
- package/dist/src/styles/cytoscape/translate.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/translate.js +156 -0
- package/dist/src/styles/cytoscape/translate.js.map +1 -0
- package/dist/src/styles/defaults.d.ts +90 -0
- package/dist/src/styles/defaults.d.ts.map +1 -0
- package/dist/src/styles/defaults.js +414 -0
- package/dist/src/styles/defaults.js.map +1 -0
- package/dist/src/styles/index.d.ts +15 -0
- package/dist/src/styles/index.d.ts.map +1 -0
- package/dist/src/styles/index.js +14 -0
- package/dist/src/styles/index.js.map +1 -0
- package/dist/src/styles/internal.d.ts +17 -0
- package/dist/src/styles/internal.d.ts.map +1 -0
- package/dist/src/styles/internal.js +16 -0
- package/dist/src/styles/internal.js.map +1 -0
- package/dist/src/styles/io/approximations.d.ts +24 -0
- package/dist/src/styles/io/approximations.d.ts.map +1 -0
- package/dist/src/styles/io/approximations.js +51 -0
- package/dist/src/styles/io/approximations.js.map +1 -0
- package/dist/src/styles/io/block.d.ts +166 -0
- package/dist/src/styles/io/block.d.ts.map +1 -0
- package/dist/src/styles/io/block.js +930 -0
- package/dist/src/styles/io/block.js.map +1 -0
- package/dist/src/styles/io/generic.d.ts +88 -0
- package/dist/src/styles/io/generic.d.ts.map +1 -0
- package/dist/src/styles/io/generic.js +516 -0
- package/dist/src/styles/io/generic.js.map +1 -0
- package/dist/src/styles/io/index.d.ts +8 -0
- package/dist/src/styles/io/index.d.ts.map +1 -0
- package/dist/src/styles/io/index.js +7 -0
- package/dist/src/styles/io/index.js.map +1 -0
- package/dist/src/styles/io/writer.d.ts +80 -0
- package/dist/src/styles/io/writer.d.ts.map +1 -0
- package/dist/src/styles/io/writer.js +596 -0
- package/dist/src/styles/io/writer.js.map +1 -0
- package/dist/src/styles/notes.d.ts +47 -0
- package/dist/src/styles/notes.d.ts.map +1 -0
- package/dist/src/styles/notes.js +140 -0
- package/dist/src/styles/notes.js.map +1 -0
- package/dist/src/styles/plan/classes.d.ts +31 -0
- package/dist/src/styles/plan/classes.d.ts.map +1 -0
- package/dist/src/styles/plan/classes.js +139 -0
- package/dist/src/styles/plan/classes.js.map +1 -0
- package/dist/src/styles/plan/continuous.d.ts +32 -0
- package/dist/src/styles/plan/continuous.d.ts.map +1 -0
- package/dist/src/styles/plan/continuous.js +165 -0
- package/dist/src/styles/plan/continuous.js.map +1 -0
- package/dist/src/styles/plan/discrete.d.ts +39 -0
- package/dist/src/styles/plan/discrete.d.ts.map +1 -0
- package/dist/src/styles/plan/discrete.js +127 -0
- package/dist/src/styles/plan/discrete.js.map +1 -0
- package/dist/src/styles/plan/families.d.ts +31 -0
- package/dist/src/styles/plan/families.d.ts.map +1 -0
- package/dist/src/styles/plan/families.js +95 -0
- package/dist/src/styles/plan/families.js.map +1 -0
- package/dist/src/styles/plan/features.d.ts +58 -0
- package/dist/src/styles/plan/features.d.ts.map +1 -0
- package/dist/src/styles/plan/features.js +185 -0
- package/dist/src/styles/plan/features.js.map +1 -0
- package/dist/src/styles/plan/index.d.ts +7 -0
- package/dist/src/styles/plan/index.d.ts.map +1 -0
- package/dist/src/styles/plan/index.js +7 -0
- package/dist/src/styles/plan/index.js.map +1 -0
- package/dist/src/styles/plan/plan.d.ts +71 -0
- package/dist/src/styles/plan/plan.d.ts.map +1 -0
- package/dist/src/styles/plan/plan.js +893 -0
- package/dist/src/styles/plan/plan.js.map +1 -0
- package/dist/src/styles/plan/resolve.d.ts +137 -0
- package/dist/src/styles/plan/resolve.d.ts.map +1 -0
- package/dist/src/styles/plan/resolve.js +587 -0
- package/dist/src/styles/plan/resolve.js.map +1 -0
- package/dist/src/styles/types.d.ts +702 -0
- package/dist/src/styles/types.d.ts.map +1 -0
- package/dist/src/styles/types.js +10 -0
- package/dist/src/styles/types.js.map +1 -0
- package/dist/src/styles/vocabulary.d.ts +41 -0
- package/dist/src/styles/vocabulary.d.ts.map +1 -0
- package/dist/src/styles/vocabulary.js +140 -0
- package/dist/src/styles/vocabulary.js.map +1 -0
- package/dist/src/types.d.ts +64 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/styles.d.ts +1 -0
- package/dist/styles.js +322 -0
- package/dist/styles.js.map +1 -0
- package/dist/xgmml.js +5 -4
- package/dist/xgmml.js.map +1 -1
- package/package.json +13 -2
- package/src/common/codes.ts +7 -0
- package/src/common/escape.ts +5 -2
- package/src/common/export.ts +179 -140
- package/src/common/input.ts +8 -4
- package/src/common/json-elements.ts +169 -38
- package/src/common/notes.ts +94 -0
- package/src/common/report.ts +41 -1
- package/src/common/units.ts +42 -0
- package/src/common/xml.ts +45 -5
- package/src/formats/cx/exporter.ts +95 -11
- package/src/formats/cx/importer.ts +126 -90
- package/src/formats/cx/styles.ts +304 -0
- package/src/formats/cx2/exporter.ts +234 -77
- package/src/formats/cx2/importer.ts +19 -1
- package/src/formats/cx2/styles.ts +29 -0
- package/src/formats/cys/constants.ts +3 -0
- package/src/formats/cys/exporter.ts +246 -60
- package/src/formats/cys/importer.ts +125 -9
- package/src/formats/cys/session.ts +6 -0
- package/src/formats/cys/styles.ts +254 -0
- package/src/formats/cys/tables.ts +117 -48
- package/src/formats/dot/exporter.ts +262 -126
- package/src/formats/dot/importer.ts +111 -20
- package/src/formats/dot/index.ts +1 -0
- package/src/formats/dot/positions.ts +77 -0
- package/src/formats/dot/styles.ts +1741 -0
- package/src/formats/gexf/exporter.ts +27 -11
- package/src/formats/gexf/importer.ts +308 -158
- package/src/formats/gexf/index.ts +10 -0
- package/src/formats/gexf/schema.ts +5 -0
- package/src/formats/gexf/styles.ts +719 -0
- package/src/formats/gml/exporter.ts +33 -14
- package/src/formats/gml/importer.ts +4 -0
- package/src/formats/gml/index.ts +2 -1
- package/src/formats/gml/positions.ts +52 -0
- package/src/formats/gml/styles.ts +1248 -0
- package/src/formats/gml/syntax.ts +173 -62
- package/src/formats/graphml/constants.ts +5 -0
- package/src/formats/graphml/exporter.ts +163 -71
- package/src/formats/graphml/importer.ts +119 -45
- package/src/formats/graphml/index.ts +1 -0
- package/src/formats/graphml/styles-plain.ts +236 -0
- package/src/formats/graphml/styles-yed.ts +1221 -0
- package/src/formats/graphml/styles-yfiles3.ts +573 -0
- package/src/formats/graphml/tree.ts +36 -20
- package/src/formats/graphml/yfiles.ts +89 -13
- package/src/formats/json/exporter.ts +76 -26
- package/src/formats/json/importer.ts +541 -322
- package/src/formats/json/positions.ts +50 -0
- package/src/formats/json/styles.ts +2082 -0
- package/src/formats/neo4j/exporter.ts +2 -1
- package/src/formats/pajek/exporter.ts +195 -106
- package/src/formats/pajek/importer.ts +78 -9
- package/src/formats/pajek/index.ts +2 -0
- package/src/formats/pajek/styles.ts +685 -0
- package/src/formats/pajek/syntax.ts +7 -0
- package/src/formats/xgmml/columns.ts +39 -9
- package/src/formats/xgmml/constants.ts +3 -0
- package/src/formats/xgmml/document.ts +54 -12
- package/src/formats/xgmml/emit.ts +11 -6
- package/src/formats/xgmml/exporter.ts +32 -13
- package/src/formats/xgmml/importer.ts +43 -29
- package/src/formats/xgmml/styles.ts +400 -0
- package/src/index.ts +16 -0
- package/src/positions/codes.ts +32 -0
- package/src/positions/convert.ts +123 -0
- package/src/positions/extract.ts +619 -0
- package/src/positions/index.ts +23 -0
- package/src/positions/types.ts +221 -0
- package/src/registry.ts +179 -8
- package/src/styles/annotations.ts +478 -0
- package/src/styles/budget.ts +60 -0
- package/src/styles/canon/bends.ts +84 -0
- package/src/styles/canon/color-tables.ts +386 -0
- package/src/styles/canon/color.ts +624 -0
- package/src/styles/canon/enums.ts +211 -0
- package/src/styles/canon/graphviz.ts +189 -0
- package/src/styles/canon/index.ts +13 -0
- package/src/styles/canon/number.ts +152 -0
- package/src/styles/canon/site.ts +87 -0
- package/src/styles/canon/text.ts +221 -0
- package/src/styles/codes.ts +104 -0
- package/src/styles/cyjs/cascade.ts +2670 -0
- package/src/styles/cyjs/defaults-table.ts +82 -0
- package/src/styles/cyjs/emit.ts +951 -0
- package/src/styles/cyjs/index.ts +37 -0
- package/src/styles/cyjs/live.ts +147 -0
- package/src/styles/cyjs/mappers.ts +879 -0
- package/src/styles/cyjs/selector.ts +778 -0
- package/src/styles/cyjs/stylesheet-text.ts +214 -0
- package/src/styles/cytoscape/emit.ts +1264 -0
- package/src/styles/cytoscape/index.ts +40 -0
- package/src/styles/cytoscape/lexicon.ts +656 -0
- package/src/styles/cytoscape/mappings.ts +603 -0
- package/src/styles/cytoscape/resolve.ts +521 -0
- package/src/styles/cytoscape/translate.ts +237 -0
- package/src/styles/defaults.ts +504 -0
- package/src/styles/index.ts +57 -0
- package/src/styles/internal.ts +17 -0
- package/src/styles/io/approximations.ts +47 -0
- package/src/styles/io/block.ts +1138 -0
- package/src/styles/io/generic.ts +687 -0
- package/src/styles/io/index.ts +18 -0
- package/src/styles/io/writer.ts +745 -0
- package/src/styles/notes.ts +165 -0
- package/src/styles/plan/classes.ts +166 -0
- package/src/styles/plan/continuous.ts +218 -0
- package/src/styles/plan/discrete.ts +165 -0
- package/src/styles/plan/families.ts +115 -0
- package/src/styles/plan/features.ts +234 -0
- package/src/styles/plan/index.ts +7 -0
- package/src/styles/plan/plan.ts +1129 -0
- package/src/styles/plan/resolve.ts +685 -0
- package/src/styles/types.ts +814 -0
- package/src/styles/vocabulary.ts +172 -0
- package/src/types.ts +76 -1
- package/dist/chunks/constants-fT3E8JYY.js.map +0 -1
- package/dist/chunks/escape-B62ZGM_a.js.map +0 -1
- package/dist/chunks/export-rKLeGQMo.js.map +0 -1
- package/dist/chunks/exporter-8hLNemFk.js.map +0 -1
- package/dist/chunks/exporter-BWwEuOPT.js.map +0 -1
- package/dist/chunks/exporter-RVtXVetw.js.map +0 -1
- package/dist/chunks/importer-BbNb7eNg.js.map +0 -1
- package/dist/chunks/importer-C98dpSH4.js.map +0 -1
- package/dist/chunks/importer-D794XUTe.js.map +0 -1
- package/dist/chunks/importer-Dz7tI8Sa.js.map +0 -1
- package/dist/chunks/importer-Ht7LNg8L.js.map +0 -1
- package/dist/chunks/importer-WrGRZb0N.js.map +0 -1
- package/dist/chunks/importer-xZ-3suY1.js.map +0 -1
- package/dist/chunks/json-elements-DKSqpNW1.js.map +0 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { GraphFormatError, INVALID_INDEX } from "@graphty/graph-format";
|
|
2
|
-
import {
|
|
3
|
-
import { h as hasIllegalXmlChar, e as escapeXmlAttribute,
|
|
4
|
-
import {
|
|
5
|
-
import { X as XGMML_ISSUE, Z as Z_COLUMN,
|
|
6
|
-
import {
|
|
2
|
+
import { a4 as decodeEntryName, h as throwIfAborted, c as capabilities, L as LOSS, r as resolveExportOptions, a as checkCapabilities, p as pairFolding, e as explicitWeights, D as DictHeuristic, ak as readBytes, t as textChunks, j as reportSinkOptions, i as reportUnusedOptions, f as chooseGraph, k as graphChosen, g as resolveImportOptions, ab as readText, I as IdCoercer, d as declareResolved } from "./export-D7IGzTG4.js";
|
|
3
|
+
import { h as hasIllegalXmlChar, e as escapeXmlAttribute, q as quoteCsvCell, t as tokenizeXml, b as xmlDeclaredEncoding, c as XmlSyntaxError } from "./escape-B1rMftd9.js";
|
|
4
|
+
import { a2 as AMBIGUOUS_GRAPH_NAME_CODE, a3 as GRAPH_NOT_FOUND_CODE, h as MULTIPLE_GRAPHS_CODE, N as NO_GRAPH_CODE, E as EMPTY_INPUT_CODE, e as DANGLING_REFERENCE_CODE, a5 as STYLES_NOT_IMPORTED_CODE, a1 as TOO_LARGE_CODE, r as UNKNOWN_ENCODING_CODE, s as ENCODING_FALLBACK_CODE, x as ELEMENT_ISSUE, y as INPUT_ISSUE, p as plural, V as agree, aO as formatDecimal, a0 as formatF64, $ as formatF32, Z as ImportReportBuilder, an as ImportError, aS as elementCount } from "./format-GDmO6m6Q.js";
|
|
5
|
+
import { X as XGMML_ISSUE, B as emitCytoscapeStyle, s as snapshotBlock, D as lossOf, f as XGMML_STYLE_CAPABILITIES, H as cytoscapeVizmapXml, Z as Z_COLUMN, g as XLINK_NAMESPACE, C as CY_NAMESPACE, h as XGMML_NAMESPACE, G as GRAPHICS_COLUMN, E as EDGE_ID_COLUMN, P as POSITION_COLUMN, k as PARENT_COLUMN, l as PARENTS_COLUMN, S as SUBGRAPH_COLUMN, N as NESTED_NETWORK_COLUMN, m as NETWORK_POINTER_COLUMN, n as NETWORKS_COLUMN, o as XGMML_ORIGIN_NAMESPACE, J as readXgmmlStyles, K as cytoscapeBackground, O as emptyCytoscapeStyle, Q as graphicsBypasses, R as resolveCytoscape, T as hiddenToVisible, U as exactFromBlock, V as cytoscapeRules, W as nonEmpty, Y as typedKey } from "./styles-_N-C8S-U.js";
|
|
6
|
+
import { x as writeStyleBlock, y as styleBlockLosses, j as StyleNotes, S as STYLE_BLOCK_NAME, a as STYLE_ISSUE, Q as dataCell } from "./block-JQiwViEt.js";
|
|
7
|
+
import { O as ORIGINAL_ID_ATTRIBUTE } from "./constants-BFUR_CtU.js";
|
|
8
|
+
import { r as resolveSettings, m as membersOf, X as XgmmlEmitter, i as isCyTrue, p as parseXgmml, d as dialectOf, b as parseCoordinate } from "./importer-BFmOP96W.js";
|
|
9
|
+
import { C as CsvRecordReader } from "./records-Nwz_rbNt.js";
|
|
7
10
|
const FORMAT = "cys";
|
|
8
11
|
const EXTENSIONS = Object.freeze([".cys"]);
|
|
9
12
|
const MIME_TYPES = Object.freeze(["application/zip"]);
|
|
@@ -67,6 +70,7 @@ const CYS_ISSUE = Object.freeze({
|
|
|
67
70
|
/** `graphName` matches several networks in the session. The import stops. */
|
|
68
71
|
AMBIGUOUS_GRAPH_NAME: AMBIGUOUS_GRAPH_NAME_CODE
|
|
69
72
|
});
|
|
73
|
+
const STYLE_COLUMN_PREFIX = "graphty.style.";
|
|
70
74
|
class ZipError extends Error {
|
|
71
75
|
/**
|
|
72
76
|
* Create the error.
|
|
@@ -644,6 +648,7 @@ const INTEGER = "java.lang.Integer";
|
|
|
644
648
|
const LONG = "java.lang.Long";
|
|
645
649
|
const BOOLEAN = "java.lang.Boolean";
|
|
646
650
|
const I32_MAX = 2147483647;
|
|
651
|
+
const CYS_STYLE_CAPABILITIES = Object.freeze({ ...XGMML_STYLE_CAPABILITIES, block: "native" });
|
|
647
652
|
const ROOT_FOLDER = "CytoscapeSession/";
|
|
648
653
|
const DEFAULT_NAME = "Network";
|
|
649
654
|
const SUID_TEXT = /^[1-9]\d*$/;
|
|
@@ -1066,85 +1071,97 @@ function networkCandidates(snapshot, name) {
|
|
|
1066
1071
|
out.push({ name: "description", source: null, javaClass: STRING, cell: () => description });
|
|
1067
1072
|
}
|
|
1068
1073
|
for (const column of snapshot.graph) {
|
|
1069
|
-
|
|
1074
|
+
if (column.meta.name !== STYLE_BLOCK_NAME) {
|
|
1075
|
+
out.push(candidateOf(column, column.meta.name));
|
|
1076
|
+
}
|
|
1070
1077
|
}
|
|
1071
1078
|
return out;
|
|
1072
1079
|
}
|
|
1073
|
-
function
|
|
1080
|
+
function addedCandidates(table, added) {
|
|
1081
|
+
const out = [];
|
|
1082
|
+
for (const [name, values] of added) {
|
|
1083
|
+
if (table.has(name)) {
|
|
1084
|
+
continue;
|
|
1085
|
+
}
|
|
1086
|
+
const kinds = new Set(values.filter((v) => v !== null).map((v) => typeof v));
|
|
1087
|
+
const [kind] = kinds;
|
|
1088
|
+
let javaClass = STRING;
|
|
1089
|
+
if (kinds.size === 1 && kind === "number") {
|
|
1090
|
+
javaClass = DOUBLE;
|
|
1091
|
+
} else if (kinds.size === 1 && kind === "boolean") {
|
|
1092
|
+
javaClass = BOOLEAN;
|
|
1093
|
+
}
|
|
1094
|
+
out.push({
|
|
1095
|
+
name,
|
|
1096
|
+
source: null,
|
|
1097
|
+
javaClass,
|
|
1098
|
+
cell: (row) => {
|
|
1099
|
+
const v = values[row] ?? null;
|
|
1100
|
+
if (v === null) {
|
|
1101
|
+
return null;
|
|
1102
|
+
}
|
|
1103
|
+
return typeof v === "number" ? formatDecimal(v) : String(v);
|
|
1104
|
+
}
|
|
1105
|
+
});
|
|
1106
|
+
}
|
|
1107
|
+
return out;
|
|
1108
|
+
}
|
|
1109
|
+
function plan(snapshot, common, styles) {
|
|
1074
1110
|
const notes = [];
|
|
1075
1111
|
const note = (code, message, column = null, count = null) => {
|
|
1076
1112
|
notes.push(Object.freeze({ code, message, column, count }));
|
|
1077
1113
|
};
|
|
1078
|
-
|
|
1114
|
+
const generic = checkCapabilities(snapshot, CYS_CAPABILITIES, common, {
|
|
1079
1115
|
roles: SLOT_ROLES,
|
|
1080
1116
|
roleNames: ROLE_NAMES,
|
|
1081
1117
|
positionDtype: "f64"
|
|
1082
|
-
})
|
|
1083
|
-
|
|
1084
|
-
notes.push(gen);
|
|
1085
|
-
}
|
|
1086
|
-
}
|
|
1118
|
+
});
|
|
1119
|
+
notes.push(...generic.filter((gen) => !SESSION_OWN_CODES.has(gen.code)));
|
|
1087
1120
|
const ids = planIds(snapshot, common, note);
|
|
1088
1121
|
const { nodeSuids, edgeSuids, mangled, fatal } = ids;
|
|
1089
1122
|
let { next } = ids;
|
|
1090
1123
|
const rootSuid = next++;
|
|
1091
1124
|
const subSuid = next++;
|
|
1092
1125
|
const folding = pairFolding(snapshot);
|
|
1093
|
-
|
|
1094
|
-
note(
|
|
1095
|
-
LOSS.MUTUAL_EXPANDED,
|
|
1096
|
-
`${folding.mutualCount} mutual pair${plural(folding.mutualCount)} ${agree(folding.mutualCount, "is", "are")} written as two directed edges; the mutual mark is lost`,
|
|
1097
|
-
null,
|
|
1098
|
-
folding.mutualCount
|
|
1099
|
-
);
|
|
1100
|
-
}
|
|
1126
|
+
noteMutualPairs(folding.mutualCount, note);
|
|
1101
1127
|
const position = snapshot.nodes.byRole("position");
|
|
1102
1128
|
const z = [...snapshot.nodes].find(isZ) ?? null;
|
|
1103
1129
|
const positionZ = position !== null && z === null;
|
|
1104
1130
|
if (position !== null) {
|
|
1105
1131
|
positionNotes(position, z, note);
|
|
1106
1132
|
}
|
|
1107
|
-
const placed = position
|
|
1108
|
-
const
|
|
1133
|
+
const placed = holdsValues(position) || holdsValues(z);
|
|
1134
|
+
const emitNotes = new StyleNotes();
|
|
1135
|
+
const styled = styles === void 0 ? null : emitCytoscapeStyle(styles.rules, snapshot, { dialect: "desktop", notes: emitNotes });
|
|
1136
|
+
const superseded = (c) => styled !== null && isKeptGraphics(c);
|
|
1137
|
+
const viewSuid = placed || styled !== null ? next++ : null;
|
|
1109
1138
|
const viewNodeBase = next;
|
|
1110
|
-
const nodeOwn = mangled ? [
|
|
1111
|
-
{
|
|
1112
|
-
name: ORIGINAL_ID_ATTRIBUTE,
|
|
1113
|
-
source: null,
|
|
1114
|
-
javaClass: STRING,
|
|
1115
|
-
// every node carries its original, so an empty id ("") is told apart from an unset cell
|
|
1116
|
-
cell: (row) => String(snapshot.ids.idOf(row))
|
|
1117
|
-
}
|
|
1118
|
-
] : [];
|
|
1139
|
+
const nodeOwn = mangled ? [originalIdCandidate(snapshot)] : [];
|
|
1119
1140
|
const nodeTable = planTable(
|
|
1120
1141
|
"node",
|
|
1121
|
-
|
|
1142
|
+
[
|
|
1143
|
+
...elementCandidates(snapshot, "node", nodeOwn, (c) => placed && c === z || superseded(c), note),
|
|
1144
|
+
...styled === null ? [] : addedCandidates(snapshot.nodes, styled.columns.node)
|
|
1145
|
+
],
|
|
1122
1146
|
snapshot.nodeCount,
|
|
1123
1147
|
note
|
|
1124
1148
|
);
|
|
1125
|
-
const
|
|
1126
|
-
const plainWeight = snapshot.edges.get("weight");
|
|
1127
|
-
if (plainWeight !== null && plainWeight.meta.role === null && !weights.weighted) {
|
|
1128
|
-
note(LOSS.WEIGHT_KEY_CLASH, `edge column "weight" reads back as the edge weight`, "weight", null);
|
|
1129
|
-
}
|
|
1130
|
-
const edgeOwn = weights.weighted ? [
|
|
1131
|
-
{
|
|
1132
|
-
name: "weight",
|
|
1133
|
-
source: null,
|
|
1134
|
-
javaClass: DOUBLE,
|
|
1135
|
-
cell: (e) => weights.isExplicit(e) ? formatDecimal(weights.value(e)) : null
|
|
1136
|
-
}
|
|
1137
|
-
] : [];
|
|
1149
|
+
const edgeOwn = weightCandidates(snapshot, note);
|
|
1138
1150
|
const edgeRows = snapshot.edgeCount;
|
|
1139
1151
|
const edgeTable = planTable(
|
|
1140
1152
|
"edge",
|
|
1141
|
-
|
|
1153
|
+
[
|
|
1154
|
+
...elementCandidates(snapshot, "edge", edgeOwn, superseded, note),
|
|
1155
|
+
...styled === null ? [] : addedCandidates(snapshot.edges, styled.columns.edge)
|
|
1156
|
+
],
|
|
1142
1157
|
edgeRows,
|
|
1143
1158
|
note
|
|
1144
1159
|
);
|
|
1145
1160
|
const name = snapshot.meta.name ?? DEFAULT_NAME;
|
|
1146
1161
|
const networkTable = planTable("network", networkCandidates(snapshot, name), 1, note);
|
|
1147
1162
|
const rootTable = [{ name: "name", javaClass: STRING, cell: () => name }];
|
|
1163
|
+
const inlineBlock = styles === void 0 ? null : writeStyleBlock(styles.rules, { inlineColumns: true, snapshot });
|
|
1164
|
+
const blockNotes = inlineBlock === null ? [] : styleBlockLosses(inlineBlock, styles?.rules.styles.rules.length ?? 0, "size");
|
|
1148
1165
|
return {
|
|
1149
1166
|
notes,
|
|
1150
1167
|
fatal,
|
|
@@ -1162,9 +1179,56 @@ function plan(snapshot, common) {
|
|
|
1162
1179
|
rootTable,
|
|
1163
1180
|
position,
|
|
1164
1181
|
z: placed ? z : null,
|
|
1165
|
-
positionZ
|
|
1182
|
+
positionZ,
|
|
1183
|
+
styled,
|
|
1184
|
+
styleNotes: [...emitNotes.list().map(lossOf), ...blockNotes],
|
|
1185
|
+
block: styles === void 0 ? snapshotBlock(snapshot) : inlineBlock
|
|
1166
1186
|
};
|
|
1167
1187
|
}
|
|
1188
|
+
const SESSION_OWN_CODES = /* @__PURE__ */ new Set([LOSS.JSON, LOSS.ID_CHARSET, LOSS.ID_MANGLED]);
|
|
1189
|
+
function noteMutualPairs(mutualCount, note) {
|
|
1190
|
+
if (mutualCount > 0) {
|
|
1191
|
+
note(
|
|
1192
|
+
LOSS.MUTUAL_EXPANDED,
|
|
1193
|
+
`${mutualCount} mutual pair${plural(mutualCount)} ${agree(mutualCount, "is", "are")} written as two directed edges; the mutual mark is lost`,
|
|
1194
|
+
null,
|
|
1195
|
+
mutualCount
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
function holdsValues(column) {
|
|
1200
|
+
return column !== null && column.nullCount < column.length;
|
|
1201
|
+
}
|
|
1202
|
+
function isKeptGraphics(c) {
|
|
1203
|
+
return c.dtype === "json" && c.meta.origin?.type === "graphics" && c.meta.origin.namespace === XGMML_ORIGIN_NAMESPACE;
|
|
1204
|
+
}
|
|
1205
|
+
function originalIdCandidate(snapshot) {
|
|
1206
|
+
return {
|
|
1207
|
+
name: ORIGINAL_ID_ATTRIBUTE,
|
|
1208
|
+
source: null,
|
|
1209
|
+
javaClass: STRING,
|
|
1210
|
+
// every node carries its original, so an empty id ("") is told apart from an unset cell
|
|
1211
|
+
cell: (row) => String(snapshot.ids.idOf(row))
|
|
1212
|
+
};
|
|
1213
|
+
}
|
|
1214
|
+
function weightCandidates(snapshot, note) {
|
|
1215
|
+
const weights = explicitWeights(snapshot);
|
|
1216
|
+
const plainWeight = snapshot.edges.get("weight");
|
|
1217
|
+
if (plainWeight !== null && plainWeight.meta.role === null && !weights.weighted) {
|
|
1218
|
+
note(LOSS.WEIGHT_KEY_CLASH, `edge column "weight" reads back as the edge weight`, "weight", null);
|
|
1219
|
+
}
|
|
1220
|
+
if (!weights.weighted) {
|
|
1221
|
+
return [];
|
|
1222
|
+
}
|
|
1223
|
+
return [
|
|
1224
|
+
{
|
|
1225
|
+
name: "weight",
|
|
1226
|
+
source: null,
|
|
1227
|
+
javaClass: DOUBLE,
|
|
1228
|
+
cell: (e) => weights.isExplicit(e) ? formatDecimal(weights.value(e)) : null
|
|
1229
|
+
}
|
|
1230
|
+
];
|
|
1231
|
+
}
|
|
1168
1232
|
function positionNotes(position, z, note) {
|
|
1169
1233
|
const { name, components } = position.meta;
|
|
1170
1234
|
if (components !== 3) {
|
|
@@ -1210,7 +1274,7 @@ function sessionEscape(text) {
|
|
|
1210
1274
|
return encodeURIComponent(wellFormed).replaceAll(/[!~'()]/g, (c) => `%${(c.codePointAt(0) ?? 0).toString(16).toUpperCase()}`).replaceAll("%20", "+").replaceAll("-", "%2D");
|
|
1211
1275
|
}
|
|
1212
1276
|
function* cyTable(title, columns, rows) {
|
|
1213
|
-
const line = (cells) => `${cells.map((c) => quoteCsvCell(c)).join(",")}
|
|
1277
|
+
const line = (cells) => `${cells.map((c) => c === null ? "" : quoteCsvCell(c)).join(",")}
|
|
1214
1278
|
`;
|
|
1215
1279
|
yield line(["CyCSV-Version", "1"]);
|
|
1216
1280
|
yield line(["SUID", ...columns.map((c) => c.name)]);
|
|
@@ -1218,7 +1282,10 @@ function* cyTable(title, columns, rows) {
|
|
|
1218
1282
|
yield line(["", ...columns.map(() => "mutable")]);
|
|
1219
1283
|
yield line([title, ""]);
|
|
1220
1284
|
for (const [suid, row] of rows) {
|
|
1221
|
-
yield line([
|
|
1285
|
+
yield line([
|
|
1286
|
+
String(suid),
|
|
1287
|
+
...columns.map((c) => c.cell(row) ?? (c.name.startsWith(STYLE_COLUMN_PREFIX) ? null : ""))
|
|
1288
|
+
]);
|
|
1222
1289
|
}
|
|
1223
1290
|
}
|
|
1224
1291
|
const XML_DECLARATION = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>\n';
|
|
@@ -1247,21 +1314,48 @@ function* networkFile(snapshot, p) {
|
|
|
1247
1314
|
yield " </graph>\n </att>\n</graph>\n";
|
|
1248
1315
|
}
|
|
1249
1316
|
function* viewFile(snapshot, p, viewSuid) {
|
|
1317
|
+
const style = p.styled === null ? "default" : p.name;
|
|
1250
1318
|
yield XML_DECLARATION;
|
|
1251
|
-
yield `<graph id="${viewSuid}" label="${viewSuid}" cy:view="1" cy:networkId="${p.subSuid}" cy:visualStyle="
|
|
1319
|
+
yield `<graph id="${viewSuid}" label="${viewSuid}" cy:view="1" cy:networkId="${p.subSuid}" cy:visualStyle="${escapeXmlAttribute(style)}" cy:rendererId="org.cytoscape.ding" cy:documentVersion="3.0" ${NAMESPACES}>
|
|
1252
1320
|
`;
|
|
1253
1321
|
let view = p.viewNodeBase;
|
|
1254
1322
|
for (let i = 0; i < snapshot.nodeCount; i++) {
|
|
1255
1323
|
const coords = viewCoords(p, i);
|
|
1256
|
-
|
|
1324
|
+
const locked = p.styled?.bypasses.node[i] ?? null;
|
|
1325
|
+
if (coords.length > 0 || locked !== null) {
|
|
1257
1326
|
yield ` <node id="${view++}" cy:nodeId="${p.nodeSuids[i]}">
|
|
1258
|
-
<graphics ${coords.join(" ")}/>
|
|
1259
|
-
</node>
|
|
1260
1327
|
`;
|
|
1328
|
+
yield* viewGraphics(coords, locked);
|
|
1329
|
+
yield " </node>\n";
|
|
1330
|
+
}
|
|
1331
|
+
}
|
|
1332
|
+
for (let e = 0; e < snapshot.edgeCount; e++) {
|
|
1333
|
+
const locked = p.styled?.bypasses.edge[e] ?? null;
|
|
1334
|
+
if (locked !== null && !p.folding.folded(e)) {
|
|
1335
|
+
yield ` <edge id="${view++}" cy:edgeId="${p.edgeSuids[e]}">
|
|
1336
|
+
`;
|
|
1337
|
+
yield* viewGraphics([], locked);
|
|
1338
|
+
yield " </edge>\n";
|
|
1261
1339
|
}
|
|
1262
1340
|
}
|
|
1263
1341
|
yield "</graph>\n";
|
|
1264
1342
|
}
|
|
1343
|
+
function* viewGraphics(coords, locked) {
|
|
1344
|
+
const head = coords.length === 0 ? " <graphics" : ` <graphics ${coords.join(" ")}`;
|
|
1345
|
+
if (locked === null) {
|
|
1346
|
+
yield `${head}/>
|
|
1347
|
+
`;
|
|
1348
|
+
return;
|
|
1349
|
+
}
|
|
1350
|
+
yield `${head}>
|
|
1351
|
+
<att name="lockedVisualProperties">
|
|
1352
|
+
`;
|
|
1353
|
+
for (const [vp, value] of locked) {
|
|
1354
|
+
yield ` <att name="${escapeXmlAttribute(vp)}" value="${escapeXmlAttribute(String(value))}" type="string" cy:type="String"/>
|
|
1355
|
+
`;
|
|
1356
|
+
}
|
|
1357
|
+
yield " </att>\n </graphics>\n";
|
|
1358
|
+
}
|
|
1265
1359
|
function viewCoords(p, i) {
|
|
1266
1360
|
const coords = [];
|
|
1267
1361
|
if (p.position?.isSet(i) === true) {
|
|
@@ -1326,9 +1420,23 @@ function* entries(snapshot, p) {
|
|
|
1326
1420
|
data: encode(viewFile(snapshot, p, p.viewSuid))
|
|
1327
1421
|
};
|
|
1328
1422
|
}
|
|
1423
|
+
if (p.styled !== null) {
|
|
1424
|
+
yield {
|
|
1425
|
+
name: `${ROOT_FOLDER}session_vizmap.xml`,
|
|
1426
|
+
data: encode([
|
|
1427
|
+
XML_DECLARATION,
|
|
1428
|
+
'<vizmap documentVersion="3.0" id="VizMap-graphty">\n',
|
|
1429
|
+
cytoscapeVizmapXml(p.styled.style, p.name),
|
|
1430
|
+
"\n</vizmap>\n"
|
|
1431
|
+
])
|
|
1432
|
+
};
|
|
1433
|
+
}
|
|
1434
|
+
if (p.block !== null) {
|
|
1435
|
+
yield { name: `${ROOT_FOLDER}${STYLE_BLOCK_NAME}`, data: new TextEncoder().encode(p.block) };
|
|
1436
|
+
}
|
|
1329
1437
|
}
|
|
1330
1438
|
async function* write(snapshot, options) {
|
|
1331
|
-
const p = plan(snapshot, resolveExportOptions(options));
|
|
1439
|
+
const p = plan(snapshot, resolveExportOptions(options), options?.styles);
|
|
1332
1440
|
await Promise.resolve();
|
|
1333
1441
|
yield* writeZip(entries(snapshot, p));
|
|
1334
1442
|
}
|
|
@@ -1336,6 +1444,7 @@ const cysExporter = Object.freeze({
|
|
|
1336
1444
|
format: FORMAT,
|
|
1337
1445
|
options: Object.freeze([]),
|
|
1338
1446
|
capabilities: CYS_CAPABILITIES,
|
|
1447
|
+
styles: Object.freeze({ capabilities: CYS_STYLE_CAPABILITIES }),
|
|
1339
1448
|
/**
|
|
1340
1449
|
* Pre-flight: what export() would lose, without writing anything.
|
|
1341
1450
|
* @param snapshot - the snapshot
|
|
@@ -1343,7 +1452,8 @@ const cysExporter = Object.freeze({
|
|
|
1343
1452
|
* @returns the notes, empty when the export is exact
|
|
1344
1453
|
*/
|
|
1345
1454
|
check(snapshot, options) {
|
|
1346
|
-
|
|
1455
|
+
const p = plan(snapshot, resolveExportOptions(options), options?.styles);
|
|
1456
|
+
return Object.freeze([...p.notes, ...p.styleNotes]);
|
|
1347
1457
|
},
|
|
1348
1458
|
/**
|
|
1349
1459
|
* Write the session as zip bytes (stored entries, one at a time).
|
|
@@ -1528,6 +1638,7 @@ function layoutOf(zipEntries, report) {
|
|
|
1528
1638
|
cysession: null,
|
|
1529
1639
|
files: /* @__PURE__ */ new Map(),
|
|
1530
1640
|
styles: [],
|
|
1641
|
+
block: null,
|
|
1531
1642
|
skipped: []
|
|
1532
1643
|
};
|
|
1533
1644
|
for (const [name, zip] of byName) {
|
|
@@ -1579,6 +1690,8 @@ function classify3(entry, layout) {
|
|
|
1579
1690
|
layout.networkList = entry;
|
|
1580
1691
|
} else if (/(^|\/)session_vizmap\.(xml|props)$/.test(path)) {
|
|
1581
1692
|
layout.styles.push(entry);
|
|
1693
|
+
} else if (path === STYLE_BLOCK_NAME) {
|
|
1694
|
+
layout.block = entry;
|
|
1582
1695
|
} else {
|
|
1583
1696
|
layout.skipped.push(entry.name);
|
|
1584
1697
|
}
|
|
@@ -1656,6 +1769,147 @@ function elementsNamed(node, name) {
|
|
|
1656
1769
|
}
|
|
1657
1770
|
return out;
|
|
1658
1771
|
}
|
|
1772
|
+
function readSessionStyles(snapshot, context) {
|
|
1773
|
+
const kept = context.kept;
|
|
1774
|
+
if (kept?.era === "2") {
|
|
1775
|
+
return readXgmmlStyles(snapshot, context, { tool: "cytoscape-fallbacks", hiddenColumn: HIDDEN_COLUMN });
|
|
1776
|
+
}
|
|
1777
|
+
const notes = new StyleNotes();
|
|
1778
|
+
const style = sessionStyle(kept, notes);
|
|
1779
|
+
const out = { node: { values: {} }, edge: { values: {} } };
|
|
1780
|
+
for (const target of ["node", "edge"]) {
|
|
1781
|
+
context.signal?.throwIfAborted();
|
|
1782
|
+
out[target] = sessionTargetStyles(snapshot, target, style, { notes, budget: context.budget });
|
|
1783
|
+
}
|
|
1784
|
+
const background = cytoscapeBackground(style, notes);
|
|
1785
|
+
return {
|
|
1786
|
+
canonical: true,
|
|
1787
|
+
dialect: "cytoscape",
|
|
1788
|
+
tool: "cytoscape-fallbacks",
|
|
1789
|
+
units: "px",
|
|
1790
|
+
node: out.node,
|
|
1791
|
+
edge: out.edge,
|
|
1792
|
+
graph: background === null ? {} : { background },
|
|
1793
|
+
notes: notes.list()
|
|
1794
|
+
};
|
|
1795
|
+
}
|
|
1796
|
+
function sessionStyle(kept, notes) {
|
|
1797
|
+
if (kept?.vizmap === null || kept?.vizmap === void 0) {
|
|
1798
|
+
const problem = kept?.problem ?? null;
|
|
1799
|
+
notes.add(problem === null ? STYLE_ISSUE.NO_VIZMAP : STYLE_ISSUE.UNREADABLE, null, "session_vizmap.xml", {
|
|
1800
|
+
sample: problem ?? "absent"
|
|
1801
|
+
});
|
|
1802
|
+
return emptyCytoscapeStyle();
|
|
1803
|
+
}
|
|
1804
|
+
return cytoscapeStyleFromVizmap(kept.vizmap, kept.visualStyle, notes);
|
|
1805
|
+
}
|
|
1806
|
+
function sessionTargetStyles(snapshot, target, style, work) {
|
|
1807
|
+
const { notes } = work;
|
|
1808
|
+
const table = target === "node" ? snapshot.nodes : snapshot.edges;
|
|
1809
|
+
const n = target === "node" ? snapshot.nodeCount : snapshot.edgeCount;
|
|
1810
|
+
for (const m of style[target].mappings.values()) {
|
|
1811
|
+
if (!table.has(m.column)) {
|
|
1812
|
+
notes.add(STYLE_ISSUE.MAPPING_COLUMN_MISSING, target, m.column, { sample: m.kind });
|
|
1813
|
+
}
|
|
1814
|
+
}
|
|
1815
|
+
const elements = {
|
|
1816
|
+
count: n,
|
|
1817
|
+
value: (column, i) => table.has(column) ? dataCell(table, column, i) : null,
|
|
1818
|
+
bypasses: graphicsBypasses(table, target, n, notes)
|
|
1819
|
+
};
|
|
1820
|
+
const values = resolveCytoscape(target, style, elements, work);
|
|
1821
|
+
hiddenToVisible(table, HIDDEN_COLUMN, n, values);
|
|
1822
|
+
exactFromBlock(snapshot, target, values);
|
|
1823
|
+
const { rules, columns } = cytoscapeRules(target, style, elements, work);
|
|
1824
|
+
return { values: nonEmpty(values), rules, columns };
|
|
1825
|
+
}
|
|
1826
|
+
function cytoscapeStyleFromVizmap(root, name, notes) {
|
|
1827
|
+
const style = emptyCytoscapeStyle();
|
|
1828
|
+
const styles = root.children.filter((c) => c.name === "visualStyle");
|
|
1829
|
+
let chosen = styles.find((s) => s.attrs.get("name") === name);
|
|
1830
|
+
if (chosen === void 0) {
|
|
1831
|
+
chosen = styles.at(0);
|
|
1832
|
+
if (chosen === void 0) {
|
|
1833
|
+
notes.add(STYLE_ISSUE.NO_VIZMAP, null, "visualStyle", { sample: "no visualStyle" });
|
|
1834
|
+
return style;
|
|
1835
|
+
}
|
|
1836
|
+
notes.add(STYLE_ISSUE.VIEW_STYLE_MISSING, null, "visualStyle", { sample: String(name) });
|
|
1837
|
+
}
|
|
1838
|
+
if (styles.length > 1) {
|
|
1839
|
+
notes.add(STYLE_ISSUE.OTHER_STYLES, null, "visualStyle", {
|
|
1840
|
+
sample: `${styles.length - 1} unused`,
|
|
1841
|
+
count: styles.length - 1
|
|
1842
|
+
});
|
|
1843
|
+
}
|
|
1844
|
+
for (const kind of ["network", "node", "edge"]) {
|
|
1845
|
+
const section = chosen.children.find((c) => c.name === kind);
|
|
1846
|
+
for (const child of section?.children ?? []) {
|
|
1847
|
+
readVizmapEntry(style, kind, child);
|
|
1848
|
+
}
|
|
1849
|
+
}
|
|
1850
|
+
return style;
|
|
1851
|
+
}
|
|
1852
|
+
function readVizmapEntry(style, kind, child) {
|
|
1853
|
+
const childName = child.attrs.get("name");
|
|
1854
|
+
if (childName === void 0) {
|
|
1855
|
+
return;
|
|
1856
|
+
}
|
|
1857
|
+
if (child.name === "dependency" && kind !== "network") {
|
|
1858
|
+
style[kind].dependencies.set(childName, child.attrs.get("value")?.trim().toLowerCase() === "true");
|
|
1859
|
+
return;
|
|
1860
|
+
}
|
|
1861
|
+
if (child.name !== "visualProperty") {
|
|
1862
|
+
return;
|
|
1863
|
+
}
|
|
1864
|
+
const d = child.attrs.get("default");
|
|
1865
|
+
if (d !== void 0) {
|
|
1866
|
+
style[kind].defaults.set(childName, d);
|
|
1867
|
+
}
|
|
1868
|
+
if (kind !== "network") {
|
|
1869
|
+
const mapping = vizmapMapping(child);
|
|
1870
|
+
if (mapping !== null) {
|
|
1871
|
+
style[kind].mappings.set(childName, mapping);
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
}
|
|
1875
|
+
function vizmapMapping(vp) {
|
|
1876
|
+
for (const m of vp.children) {
|
|
1877
|
+
const column = m.attrs.get("attributeName");
|
|
1878
|
+
if (column === void 0) {
|
|
1879
|
+
continue;
|
|
1880
|
+
}
|
|
1881
|
+
const type = m.attrs.get("attributeType") ?? null;
|
|
1882
|
+
if (m.name === "passthroughMapping") {
|
|
1883
|
+
return { kind: "passthrough", column, type };
|
|
1884
|
+
}
|
|
1885
|
+
if (m.name === "discreteMapping") {
|
|
1886
|
+
return { kind: "discrete", column, type, table: discreteTable(m, type) };
|
|
1887
|
+
}
|
|
1888
|
+
if (m.name === "continuousMapping") {
|
|
1889
|
+
return { kind: "continuous", column, type, points: continuousPoints(m) };
|
|
1890
|
+
}
|
|
1891
|
+
}
|
|
1892
|
+
return null;
|
|
1893
|
+
}
|
|
1894
|
+
function discreteTable(m, type) {
|
|
1895
|
+
const table = [];
|
|
1896
|
+
for (const e of m.children) {
|
|
1897
|
+
const key = typedKey(e.attrs.get("attributeValue"), type);
|
|
1898
|
+
const value = e.attrs.get("value");
|
|
1899
|
+
if (e.name === "discreteMappingEntry" && key !== null && value !== void 0) {
|
|
1900
|
+
table.push([key, value]);
|
|
1901
|
+
}
|
|
1902
|
+
}
|
|
1903
|
+
return table;
|
|
1904
|
+
}
|
|
1905
|
+
function continuousPoints(m) {
|
|
1906
|
+
return m.children.filter((p) => p.name === "continuousMappingPoint" && Number.isFinite(Number(p.attrs.get("attrValue")))).map((p) => ({
|
|
1907
|
+
at: Number(p.attrs.get("attrValue")),
|
|
1908
|
+
below: p.attrs.get("lesserValue"),
|
|
1909
|
+
value: p.attrs.get("equalValue"),
|
|
1910
|
+
above: p.attrs.get("greaterValue")
|
|
1911
|
+
}));
|
|
1912
|
+
}
|
|
1659
1913
|
const JAVA_TYPES = {
|
|
1660
1914
|
"java.lang.String": "String",
|
|
1661
1915
|
"java.lang.Long": "Long",
|
|
@@ -1665,70 +1919,92 @@ const JAVA_TYPES = {
|
|
|
1665
1919
|
};
|
|
1666
1920
|
const LIST_CLASS = /^java\.util\.List<\s*([\w.]+)\s*>$/;
|
|
1667
1921
|
async function readCyTable(bytes, path, entry, report, common) {
|
|
1922
|
+
const records = await tableRecords(bytes, common);
|
|
1923
|
+
if (typeof records === "string") {
|
|
1924
|
+
return tableError(report, entry, records);
|
|
1925
|
+
}
|
|
1926
|
+
const header = tableHeader(records);
|
|
1927
|
+
if (typeof header === "string") {
|
|
1928
|
+
return tableError(report, entry, header);
|
|
1929
|
+
}
|
|
1930
|
+
const columns = tableColumns(records[header.at].cells, records[header.at + 1].cells);
|
|
1931
|
+
if (typeof columns === "string") {
|
|
1932
|
+
return tableError(report, entry, columns);
|
|
1933
|
+
}
|
|
1934
|
+
const { rows, lines, quotedEmpty, problems } = tableRows(records.slice(header.at + header.lines), columns.length);
|
|
1935
|
+
if (problems.short + problems.long + problems.repeated > 0) {
|
|
1936
|
+
report.warning(
|
|
1937
|
+
"parse-error",
|
|
1938
|
+
CYS_ISSUE.TABLE_ROW,
|
|
1939
|
+
`${entryLabel(entry)}: ${problems.short} row${plural(problems.short)} with too few cells (the rest are unset), ${problems.long} with too many (the extra cells are ignored), ${problems.repeated} repeating a key (the first row is read)`
|
|
1940
|
+
);
|
|
1941
|
+
}
|
|
1942
|
+
return { path, entry, columns, rows, lines, quotedEmpty };
|
|
1943
|
+
}
|
|
1944
|
+
async function tableRecords(bytes, common) {
|
|
1668
1945
|
const scratch = new ImportReportBuilder(FORMAT, 0);
|
|
1669
1946
|
const reader = new CsvRecordReader(bytes, scratch, { delimiter: ",", encoding: "utf-8", signal: common.signal });
|
|
1670
1947
|
const records = [];
|
|
1671
1948
|
try {
|
|
1672
1949
|
for await (const cells of reader) {
|
|
1673
|
-
|
|
1950
|
+
const empty = cells.flatMap((cell, i) => cell.length === 0 && reader.quoted[i] ? [i] : []);
|
|
1951
|
+
records.push({ cells, line: reader.line, quotedEmpty: empty.length === 0 ? void 0 : new Set(empty) });
|
|
1674
1952
|
}
|
|
1675
1953
|
} catch (err) {
|
|
1676
1954
|
if (err instanceof ImportError) {
|
|
1677
|
-
return
|
|
1955
|
+
return scratch.issues.at(-1)?.message ?? err.message;
|
|
1678
1956
|
}
|
|
1679
1957
|
throw err;
|
|
1680
1958
|
}
|
|
1959
|
+
return records;
|
|
1960
|
+
}
|
|
1961
|
+
function tableHeader(records) {
|
|
1681
1962
|
let at = 0;
|
|
1682
1963
|
let version = 0;
|
|
1683
1964
|
if (records[0]?.cells[0] === "CyCSV-Version") {
|
|
1684
1965
|
const { cells } = records[0];
|
|
1685
1966
|
if (cells.length !== 2 || !/^\d+$/.test(cells[1].trim())) {
|
|
1686
|
-
return
|
|
1967
|
+
return `the version row ${JSON.stringify(cells)} does not parse`;
|
|
1687
1968
|
}
|
|
1688
1969
|
version = Number(cells[1]);
|
|
1689
1970
|
at = 1;
|
|
1690
1971
|
}
|
|
1691
1972
|
if (version !== 0 && version !== 1) {
|
|
1692
|
-
return
|
|
1973
|
+
return `CyCSV version "${records[0].cells[1]}" is not 0 or 1`;
|
|
1693
1974
|
}
|
|
1694
|
-
|
|
1695
|
-
if (records.length < at +
|
|
1696
|
-
return
|
|
1975
|
+
const lines = version === 1 ? 4 : 3;
|
|
1976
|
+
if (records.length < at + lines - 1) {
|
|
1977
|
+
return "the table header is incomplete";
|
|
1697
1978
|
}
|
|
1698
|
-
const beforeTitle = records[at +
|
|
1699
|
-
const title = records.at(at +
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
const classes = records[at + 1].cells;
|
|
1979
|
+
const beforeTitle = records[at + lines - 2];
|
|
1980
|
+
const title = records.at(at + lines - 1);
|
|
1981
|
+
const titleBlank = title === void 0 || title.line > beforeTitle.line + 1 && !beforeTitle.cells.some((c) => /[\r\n]/.test(c));
|
|
1982
|
+
return { at, lines: titleBlank ? lines - 1 : lines };
|
|
1983
|
+
}
|
|
1984
|
+
function tableColumns(names, classes) {
|
|
1705
1985
|
if (names.length === 0 || classes.length !== names.length) {
|
|
1706
|
-
return
|
|
1707
|
-
report,
|
|
1708
|
-
entry,
|
|
1709
|
-
`${names.length} column name${plural(names.length)} but ${classes.length} column class(es)`
|
|
1710
|
-
);
|
|
1986
|
+
return `${names.length} column name${plural(names.length)} but ${classes.length} column class(es)`;
|
|
1711
1987
|
}
|
|
1712
1988
|
const columns = [];
|
|
1713
1989
|
for (let i = 0; i < names.length; i++) {
|
|
1714
1990
|
const column = columnOf(names[i], classes[i]);
|
|
1715
1991
|
if (column === null) {
|
|
1716
|
-
return
|
|
1717
|
-
report,
|
|
1718
|
-
entry,
|
|
1719
|
-
`column "${names[i]}" has the class "${classes[i]}", which graph-io cannot read`
|
|
1720
|
-
);
|
|
1992
|
+
return `column "${names[i]}" has the class "${classes[i]}", which graph-io cannot read`;
|
|
1721
1993
|
}
|
|
1722
1994
|
columns.push(column);
|
|
1723
1995
|
}
|
|
1996
|
+
return columns;
|
|
1997
|
+
}
|
|
1998
|
+
function tableRows(records, width) {
|
|
1724
1999
|
const rows = /* @__PURE__ */ new Map();
|
|
1725
2000
|
const lines = /* @__PURE__ */ new Map();
|
|
2001
|
+
const quotedEmpty = /* @__PURE__ */ new Map();
|
|
1726
2002
|
const problems = { short: 0, long: 0, repeated: 0 };
|
|
1727
|
-
for (const record of records
|
|
2003
|
+
for (const record of records) {
|
|
1728
2004
|
const { cells } = record;
|
|
1729
|
-
if (cells.length <
|
|
2005
|
+
if (cells.length < width) {
|
|
1730
2006
|
problems.short++;
|
|
1731
|
-
} else if (cells.length >
|
|
2007
|
+
} else if (cells.length > width) {
|
|
1732
2008
|
problems.long++;
|
|
1733
2009
|
}
|
|
1734
2010
|
const key = cells[0];
|
|
@@ -1736,17 +2012,13 @@ async function readCyTable(bytes, path, entry, report, common) {
|
|
|
1736
2012
|
problems.repeated++;
|
|
1737
2013
|
continue;
|
|
1738
2014
|
}
|
|
1739
|
-
rows.set(key, cells.slice(0,
|
|
2015
|
+
rows.set(key, cells.slice(0, width));
|
|
1740
2016
|
lines.set(key, record.line);
|
|
2017
|
+
if (record.quotedEmpty !== void 0) {
|
|
2018
|
+
quotedEmpty.set(key, record.quotedEmpty);
|
|
2019
|
+
}
|
|
1741
2020
|
}
|
|
1742
|
-
|
|
1743
|
-
report.warning(
|
|
1744
|
-
"parse-error",
|
|
1745
|
-
CYS_ISSUE.TABLE_ROW,
|
|
1746
|
-
`${entryLabel(entry)}: ${problems.short} row${plural(problems.short)} with too few cells (the rest are unset), ${problems.long} with too many (the extra cells are ignored), ${problems.repeated} repeating a key (the first row is read)`
|
|
1747
|
-
);
|
|
1748
|
-
}
|
|
1749
|
-
return { path, entry, columns, rows, lines };
|
|
2021
|
+
return { rows, lines, quotedEmpty, problems };
|
|
1750
2022
|
}
|
|
1751
2023
|
function columnOf(name, javaClass) {
|
|
1752
2024
|
const scalar = JAVA_TYPES[javaClass.trim()];
|
|
@@ -1761,13 +2033,13 @@ function tableError(report, entry, reason) {
|
|
|
1761
2033
|
report.error("parse-error", CYS_ISSUE.TABLE, `${entryLabel(entry)}: ${reason}; the table is not read`);
|
|
1762
2034
|
return null;
|
|
1763
2035
|
}
|
|
1764
|
-
function cellAtt(column, text, line, namespace, hidden) {
|
|
2036
|
+
function cellAtt(column, text, line, namespace, hidden, quoted = false) {
|
|
1765
2037
|
const cell = { line, namespace, hidden };
|
|
1766
2038
|
if (text.startsWith("=")) {
|
|
1767
2039
|
return att(column.name, column.list ? "List" : column.type, null, text, true, cell);
|
|
1768
2040
|
}
|
|
1769
2041
|
if (!column.list) {
|
|
1770
|
-
if (text.length === 0 && column.type !== "String") {
|
|
2042
|
+
if (text.length === 0 && (column.type !== "String" || !quoted && column.name.startsWith(STYLE_COLUMN_PREFIX))) {
|
|
1771
2043
|
return null;
|
|
1772
2044
|
}
|
|
1773
2045
|
return att(column.name, column.type, null, text, false, cell);
|
|
@@ -1785,10 +2057,10 @@ function cellAtt(column, text, line, namespace, hidden) {
|
|
|
1785
2057
|
return list;
|
|
1786
2058
|
}
|
|
1787
2059
|
function javaSplitLines(text) {
|
|
1788
|
-
if (!text.includes("\n")) {
|
|
2060
|
+
if (!text.includes("\n") && !text.includes("\r")) {
|
|
1789
2061
|
return [text];
|
|
1790
2062
|
}
|
|
1791
|
-
const items = text.split(
|
|
2063
|
+
const items = text.split(/\r\n|\r|\n/);
|
|
1792
2064
|
while (items.at(-1)?.length === 0) {
|
|
1793
2065
|
items.pop();
|
|
1794
2066
|
}
|
|
@@ -2096,7 +2368,7 @@ async function import3(prepared, choice, sink, parsed) {
|
|
|
2096
2368
|
const edges = byId(members.edges);
|
|
2097
2369
|
const restore = saveRecords(graph, nodes, edges);
|
|
2098
2370
|
try {
|
|
2099
|
-
await fill3(prepared, choice, sink, parsed, nodes, edges);
|
|
2371
|
+
return await fill3(prepared, choice, sink, parsed, nodes, edges);
|
|
2100
2372
|
} finally {
|
|
2101
2373
|
restore();
|
|
2102
2374
|
}
|
|
@@ -2141,6 +2413,10 @@ async function fill3(prepared, choice, sink, parsed, nodes, edges) {
|
|
|
2141
2413
|
}
|
|
2142
2414
|
const restoredIds = inner.restoreMangledIds ? restoreIds(members.nodes) : /* @__PURE__ */ new Map();
|
|
2143
2415
|
const { visualStyle, extraViews, extraIds } = await readViews(prepared, choice, nodes, edges);
|
|
2416
|
+
const block = prepared.session.layout.block === null ? null : await entryText(prepared, prepared.session.layout.block);
|
|
2417
|
+
if (block !== null) {
|
|
2418
|
+
graph.atts.push(textAtt(STYLE_BLOCK_NAME, block));
|
|
2419
|
+
}
|
|
2144
2420
|
const cyMeta = sessionMeta(prepared, {
|
|
2145
2421
|
collection: doc.root.label ?? choice.network.title,
|
|
2146
2422
|
network: choice.graphId,
|
|
@@ -2174,6 +2450,7 @@ async function fill3(prepared, choice, sink, parsed, nodes, edges) {
|
|
|
2174
2450
|
}
|
|
2175
2451
|
reportRootOnly(parsed, report, choice.network.name);
|
|
2176
2452
|
writeViewPositions(sink, extraViews, extraIds, report, prepared.inner, restoredIds);
|
|
2453
|
+
return visualStyle;
|
|
2177
2454
|
}
|
|
2178
2455
|
function groupNodeIds(nodes) {
|
|
2179
2456
|
return new Set(
|
|
@@ -2261,7 +2538,8 @@ function rowAtts(table, key, cells, namespace, hidden) {
|
|
|
2261
2538
|
const line = table.lines.get(key) ?? 0;
|
|
2262
2539
|
const out = [];
|
|
2263
2540
|
for (let i = 1; i < table.columns.length && i < cells.length; i++) {
|
|
2264
|
-
|
|
2541
|
+
const quoted = table.quotedEmpty?.get(key)?.has(i) === true;
|
|
2542
|
+
pushAtt(out, cellAtt(table.columns[i], cells[i], line, namespace, hidden, quoted));
|
|
2265
2543
|
}
|
|
2266
2544
|
return out;
|
|
2267
2545
|
}
|
|
@@ -2667,6 +2945,7 @@ async function import2(prepared, choice, sink) {
|
|
|
2667
2945
|
};
|
|
2668
2946
|
const settings = { labelAliases: true, cytoscapeEscapes: true, zAs: prepared.zAs };
|
|
2669
2947
|
new XgmmlEmitter(doc, dialect, sink, report, inner, settings, extras).emit(null);
|
|
2948
|
+
return cyMeta.visualStyle;
|
|
2670
2949
|
}
|
|
2671
2950
|
function idsIn(record, list) {
|
|
2672
2951
|
const out = /* @__PURE__ */ new Set();
|
|
@@ -2738,15 +3017,82 @@ function sessionMeta(prepared, facts) {
|
|
|
2738
3017
|
}
|
|
2739
3018
|
async function importChoice(prepared, index, sink) {
|
|
2740
3019
|
const choice = prepared.choices[index];
|
|
3020
|
+
let visualStyle;
|
|
2741
3021
|
if (choice.era === "3") {
|
|
2742
3022
|
const parsed = prepared.docs.get(choice.network.name);
|
|
2743
|
-
await import3(prepared, choice, sink, parsed);
|
|
3023
|
+
visualStyle = await import3(prepared, choice, sink, parsed);
|
|
2744
3024
|
} else {
|
|
2745
|
-
await import2(prepared, choice, sink);
|
|
3025
|
+
visualStyle = await import2(prepared, choice, sink);
|
|
2746
3026
|
}
|
|
3027
|
+
await keepStyleSource(prepared, index, visualStyle);
|
|
2747
3028
|
throwIfAborted(prepared.common.signal);
|
|
2748
3029
|
return prepared.report.finish();
|
|
2749
3030
|
}
|
|
3031
|
+
async function keepStyleSource(prepared, index, visualStyle) {
|
|
3032
|
+
const { layout } = prepared.session;
|
|
3033
|
+
const entry = layout.styles.find((e) => e.path.endsWith("session_vizmap.xml"));
|
|
3034
|
+
let vizmap = null;
|
|
3035
|
+
let problem = null;
|
|
3036
|
+
if (layout.era === "3" && entry !== void 0) {
|
|
3037
|
+
const bytes = await entryBytes(prepared, entry);
|
|
3038
|
+
const tree = typeof bytes === "string" ? bytes : await parseXmlTree(bytes, entry.name, new ImportReportBuilder(FORMAT, 0), prepared.inner);
|
|
3039
|
+
if (typeof tree === "string") {
|
|
3040
|
+
problem = tree;
|
|
3041
|
+
} else {
|
|
3042
|
+
vizmap = tree;
|
|
3043
|
+
}
|
|
3044
|
+
}
|
|
3045
|
+
const source = {
|
|
3046
|
+
era: layout.era,
|
|
3047
|
+
vizmap,
|
|
3048
|
+
problem,
|
|
3049
|
+
visualStyle,
|
|
3050
|
+
network: { index, name: prepared.choices[index].name }
|
|
3051
|
+
};
|
|
3052
|
+
prepared.report.keepForStyles(source);
|
|
3053
|
+
}
|
|
3054
|
+
async function entryBytes(prepared, entry) {
|
|
3055
|
+
try {
|
|
3056
|
+
return await prepared.session.read(entry, new ImportReportBuilder(FORMAT, 0));
|
|
3057
|
+
} catch (err) {
|
|
3058
|
+
if (err instanceof ImportError) {
|
|
3059
|
+
return err.message;
|
|
3060
|
+
}
|
|
3061
|
+
throw err;
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
async function entryText(prepared, entry) {
|
|
3065
|
+
const bytes = await entryBytes(prepared, entry);
|
|
3066
|
+
if (typeof bytes === "string") {
|
|
3067
|
+
return null;
|
|
3068
|
+
}
|
|
3069
|
+
try {
|
|
3070
|
+
return await readText(bytes, new ImportReportBuilder(FORMAT, 0), { signal: prepared.common.signal });
|
|
3071
|
+
} catch (err) {
|
|
3072
|
+
if (err instanceof ImportError) {
|
|
3073
|
+
return null;
|
|
3074
|
+
}
|
|
3075
|
+
throw err;
|
|
3076
|
+
}
|
|
3077
|
+
}
|
|
3078
|
+
function textAtt(name, value) {
|
|
3079
|
+
return {
|
|
3080
|
+
name,
|
|
3081
|
+
type: "string",
|
|
3082
|
+
cyType: "String",
|
|
3083
|
+
elementType: null,
|
|
3084
|
+
value,
|
|
3085
|
+
hidden: false,
|
|
3086
|
+
equation: false,
|
|
3087
|
+
children: [],
|
|
3088
|
+
extra: {},
|
|
3089
|
+
xml: null,
|
|
3090
|
+
hasGraph: false,
|
|
3091
|
+
text: "",
|
|
3092
|
+
line: 0,
|
|
3093
|
+
namespace: null
|
|
3094
|
+
};
|
|
3095
|
+
}
|
|
2750
3096
|
async function importCys(input, sink, options) {
|
|
2751
3097
|
const prepared = await prepare(input, sink, options);
|
|
2752
3098
|
const index = chooseGraph(
|
|
@@ -2813,7 +3159,8 @@ const cysImporter = Object.freeze({
|
|
|
2813
3159
|
sniff: sniffCys,
|
|
2814
3160
|
import: importCys,
|
|
2815
3161
|
importAll: importAllCys,
|
|
2816
|
-
listGraphs: listCysGraphs
|
|
3162
|
+
listGraphs: listCysGraphs,
|
|
3163
|
+
styles: readSessionStyles
|
|
2817
3164
|
});
|
|
2818
3165
|
export {
|
|
2819
3166
|
CYS_CAPABILITIES as C,
|
|
@@ -2822,4 +3169,4 @@ export {
|
|
|
2822
3169
|
cysExporter as c,
|
|
2823
3170
|
cysImporter as d
|
|
2824
3171
|
};
|
|
2825
|
-
//# sourceMappingURL=importer-
|
|
3172
|
+
//# sourceMappingURL=importer-B7r2owVf.js.map
|