@graphty/graph-io 0.3.43 → 0.3.45
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-DJMHdDvv.js +40 -0
- package/dist/chunks/approximations-DJMHdDvv.js.map +1 -0
- package/dist/chunks/block-CPCHkX42.js +2777 -0
- package/dist/chunks/block-CPCHkX42.js.map +1 -0
- package/dist/chunks/{choose-DvpbdRuz.js → choose--jM0yYCo.js} +3 -2
- package/dist/chunks/{choose-DvpbdRuz.js.map → choose--jM0yYCo.js.map} +1 -1
- package/dist/chunks/{constants-fT3E8JYY.js → constants-BKwqelYD.js} +6 -2
- package/dist/chunks/constants-BKwqelYD.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-DZy6JgdA.js +3456 -0
- package/dist/chunks/emit-DZy6JgdA.js.map +1 -0
- package/dist/chunks/{escape-B62ZGM_a.js → escape-CgzxiYPg.js} +44 -21
- package/dist/chunks/escape-CgzxiYPg.js.map +1 -0
- package/dist/chunks/{export-rKLeGQMo.js → export-BvqAXCKh.js} +196 -792
- package/dist/chunks/export-BvqAXCKh.js.map +1 -0
- package/dist/chunks/{exporter-yLxKBvLE.js → exporter--Mk9gXCJ.js} +4 -3
- package/dist/chunks/{exporter-yLxKBvLE.js.map → exporter--Mk9gXCJ.js.map} +1 -1
- package/dist/chunks/{exporter-RVtXVetw.js → exporter-C-9cgZKa.js} +1805 -287
- package/dist/chunks/exporter-C-9cgZKa.js.map +1 -0
- package/dist/chunks/{exporter-8hLNemFk.js → exporter-DFqJhBnj.js} +133 -74
- package/dist/chunks/exporter-DFqJhBnj.js.map +1 -0
- package/dist/chunks/{exporter-BWwEuOPT.js → exporter-DteVeJki.js} +22 -12
- package/dist/chunks/exporter-DteVeJki.js.map +1 -0
- package/dist/chunks/format-BpQBx8MZ.js +676 -0
- package/dist/chunks/format-BpQBx8MZ.js.map +1 -0
- package/dist/chunks/generic-BGO71QBv.js +1347 -0
- package/dist/chunks/generic-BGO71QBv.js.map +1 -0
- package/dist/chunks/{importer-C98dpSH4.js → importer-B-9Rc1zO.js} +141 -82
- package/dist/chunks/importer-B-9Rc1zO.js.map +1 -0
- package/dist/chunks/{importer-D794XUTe.js → importer-BVVR740x.js} +31 -8
- package/dist/chunks/importer-BVVR740x.js.map +1 -0
- package/dist/chunks/{importer-WrGRZb0N.js → importer-C0AjA3Ax.js} +449 -102
- package/dist/chunks/importer-C0AjA3Ax.js.map +1 -0
- package/dist/chunks/{importer-BbNb7eNg.js → importer-C7pvJe1L.js} +1398 -129
- package/dist/chunks/importer-C7pvJe1L.js.map +1 -0
- package/dist/chunks/{importer-xZ-3suY1.js → importer-ClwoVx3O.js} +791 -135
- package/dist/chunks/importer-ClwoVx3O.js.map +1 -0
- package/dist/chunks/{importer-Ht7LNg8L.js → importer-D0sC_6bO.js} +116 -296
- package/dist/chunks/importer-D0sC_6bO.js.map +1 -0
- package/dist/chunks/{importer-Dz7tI8Sa.js → importer-EHQk1jbM.js} +617 -115
- package/dist/chunks/importer-EHQk1jbM.js.map +1 -0
- package/dist/chunks/{json-elements-DKSqpNW1.js → json-elements-DJZRZ6jd.js} +123 -32
- package/dist/chunks/json-elements-DJZRZ6jd.js.map +1 -0
- package/dist/chunks/lexicon-WMsNddyU.js +509 -0
- package/dist/chunks/lexicon-WMsNddyU.js.map +1 -0
- package/dist/chunks/{ontology-export-CtRXjg_i.js → ontology-export-G4MqRdux.js} +3 -2
- package/dist/chunks/{ontology-export-CtRXjg_i.js.map → ontology-export-G4MqRdux.js.map} +1 -1
- package/dist/chunks/{records-Cu4bxYOm.js → records-CiaWZrFH.js} +2 -2
- package/dist/chunks/{records-Cu4bxYOm.js.map → records-CiaWZrFH.js.map} +1 -1
- package/dist/chunks/styles-DvoFBKCK.js +690 -0
- package/dist/chunks/styles-DvoFBKCK.js.map +1 -0
- package/dist/chunks/styles-yed-Cz9rLBCP.js +842 -0
- package/dist/chunks/styles-yed-Cz9rLBCP.js.map +1 -0
- package/dist/chunks/styles-zNTmz5R7.js +2102 -0
- package/dist/chunks/styles-zNTmz5R7.js.map +1 -0
- package/dist/chunks/{text-DHOJXnED.js → text-CzJNFOS9.js} +2 -2
- package/dist/chunks/{text-DHOJXnED.js.map → text-CzJNFOS9.js.map} +1 -1
- package/dist/chunks/units-XMZFIFe1.js +19 -0
- package/dist/chunks/units-XMZFIFe1.js.map +1 -0
- package/dist/chunks/writer-gQ8kx99H.js +448 -0
- package/dist/chunks/writer-gQ8kx99H.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 +927 -74
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +351 -236
- 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 +1496 -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 +791 -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 +605 -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 +89 -0
- package/dist/src/styles/io/writer.d.ts.map +1 -0
- package/dist/src/styles/io/writer.js +626 -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 +1755 -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 +952 -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 +658 -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 +780 -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
|
@@ -0,0 +1,521 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cytoscape's own resolution of a visual style, per element: a bypass over a mapping over a default, per visual
|
|
3
|
+
* property, with the dependencies applied (`nodeSizeLocked` makes `NODE_SIZE` drive width and height,
|
|
4
|
+
* `arrowColorMatchesEdge` makes the edge's paint drive the line and both arrows). Every pass is linear in the number
|
|
5
|
+
* of elements plus the size of the style, and spends from the extraction's one budget.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import type { CanonSite } from "../canon/site.js";
|
|
9
|
+
import { STYLE_ISSUE } from "../codes.js";
|
|
10
|
+
import { toolDefaults } from "../defaults.js";
|
|
11
|
+
import { StyleNotes } from "../notes.js";
|
|
12
|
+
import { discreteLookup, evalContinuous, numberOf } from "../plan/resolve.js";
|
|
13
|
+
import type {
|
|
14
|
+
ContinuousPoint,
|
|
15
|
+
Scalar,
|
|
16
|
+
StyleColor,
|
|
17
|
+
StyleColumn,
|
|
18
|
+
StyleTarget,
|
|
19
|
+
StyleTool,
|
|
20
|
+
StyleValue,
|
|
21
|
+
StyleWorkBudget,
|
|
22
|
+
} from "../types.js";
|
|
23
|
+
import { isStyleValue } from "../vocabulary.js";
|
|
24
|
+
import {
|
|
25
|
+
colorParser,
|
|
26
|
+
CYTOSCAPE_LEXICON,
|
|
27
|
+
type CytoscapeValueParser,
|
|
28
|
+
isUncarriedVp,
|
|
29
|
+
NODE_SIZE_VP,
|
|
30
|
+
sizeParser,
|
|
31
|
+
} from "./lexicon.js";
|
|
32
|
+
import {
|
|
33
|
+
type CytoscapeContinuousPoint,
|
|
34
|
+
type CytoscapeMapping,
|
|
35
|
+
type CytoscapeStyle,
|
|
36
|
+
type CytoscapeTargetStyle,
|
|
37
|
+
emptyCytoscapeStyle,
|
|
38
|
+
} from "./mappings.js";
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* One element's bypasses: visual property name to raw value; null or undefined when it has none.
|
|
42
|
+
* @category Styles
|
|
43
|
+
*/
|
|
44
|
+
export type CytoscapeBypass = ReadonlyMap<string, unknown> | null | undefined;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* The elements of one target a style is resolved over.
|
|
48
|
+
* @category Styles
|
|
49
|
+
*/
|
|
50
|
+
export interface CytoscapeElements {
|
|
51
|
+
/** How many elements there are. */
|
|
52
|
+
readonly count: number;
|
|
53
|
+
/**
|
|
54
|
+
* An element's value of an attribute column (a list attribute as an array), or null.
|
|
55
|
+
* @param column - the column's name
|
|
56
|
+
* @param i - the element index
|
|
57
|
+
* @returns the value
|
|
58
|
+
*/
|
|
59
|
+
value(column: string, i: number): unknown;
|
|
60
|
+
/** Each element's bypasses, by element index. */
|
|
61
|
+
readonly bypasses?: readonly CytoscapeBypass[];
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* Options of `resolveCytoscape()`.
|
|
66
|
+
* @category Styles
|
|
67
|
+
*/
|
|
68
|
+
export interface CytoscapeResolveOptions {
|
|
69
|
+
/** Where problems are noted. */
|
|
70
|
+
readonly notes?: StyleNotes;
|
|
71
|
+
/** The counted work budget. */
|
|
72
|
+
readonly budget?: StyleWorkBudget;
|
|
73
|
+
/**
|
|
74
|
+
* Whose defaults fill what the style leaves unset: `"cytoscape"` (the desktop's default visual style, for CX,
|
|
75
|
+
* CX2 and XGMML), `"cytoscape-fallbacks"` (the renderer's fallbacks, for sessions) or null for none, so an
|
|
76
|
+
* element the style says nothing about is null. Defaults to null.
|
|
77
|
+
*/
|
|
78
|
+
readonly defaults?: StyleTool | null;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Locked node sizes with no `NODE_SIZE` anywhere draw at Cytoscape's lexicon default. */
|
|
82
|
+
const NODE_SIZE_FALLBACK = 50;
|
|
83
|
+
|
|
84
|
+
/** A visual property and the parser that reads it for one neutral property. */
|
|
85
|
+
type VpChoice = readonly [vp: string, parse: CytoscapeValueParser];
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Which visual properties a style or its bypasses mention.
|
|
89
|
+
* @param style - the target's style
|
|
90
|
+
* @param bypasses - the elements' bypasses
|
|
91
|
+
* @returns the names used anywhere, and those used by a bypass
|
|
92
|
+
*/
|
|
93
|
+
export function vpUsage(
|
|
94
|
+
style: CytoscapeTargetStyle,
|
|
95
|
+
bypasses: readonly CytoscapeBypass[],
|
|
96
|
+
): { used: Set<string>; bypassed: Set<string> } {
|
|
97
|
+
const bypassed = new Set<string>();
|
|
98
|
+
for (const b of bypasses) {
|
|
99
|
+
if (b) {
|
|
100
|
+
for (const k of b.keys()) {
|
|
101
|
+
bypassed.add(k);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
for (const [from, to] of style.bypassAliases) {
|
|
106
|
+
if (bypassed.has(from)) {
|
|
107
|
+
bypassed.add(to);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
const used = new Set([...style.defaults.keys(), ...style.mappings.keys(), ...bypassed]);
|
|
111
|
+
return { used, bypassed };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Which visual property sets each neutral property: the first of its lexicon list the style or any bypass
|
|
116
|
+
* mentions, with the dependencies applied.
|
|
117
|
+
* @param target - nodes or edges
|
|
118
|
+
* @param style - the target's style
|
|
119
|
+
* @param used - the visual properties used anywhere
|
|
120
|
+
* @returns property to its visual property and parser
|
|
121
|
+
*/
|
|
122
|
+
export function chooseVps(
|
|
123
|
+
target: StyleTarget,
|
|
124
|
+
style: CytoscapeTargetStyle,
|
|
125
|
+
used: ReadonlySet<string>,
|
|
126
|
+
): Map<string, VpChoice> {
|
|
127
|
+
const chosen = new Map<string, VpChoice>();
|
|
128
|
+
for (const [prop, list] of CYTOSCAPE_LEXICON[target]) {
|
|
129
|
+
const hit = list.find(([vp]) => used.has(vp));
|
|
130
|
+
if (hit !== undefined) {
|
|
131
|
+
chosen.set(prop, hit);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (target === "node" && style.dependencies.get("nodeSizeLocked") === true) {
|
|
135
|
+
chosen.delete("width");
|
|
136
|
+
chosen.delete("height");
|
|
137
|
+
}
|
|
138
|
+
if (target === "edge" && style.dependencies.get("arrowColorMatchesEdge") === true) {
|
|
139
|
+
if (used.has("EDGE_UNSELECTED_PAINT")) {
|
|
140
|
+
chosen.set("color", ["EDGE_UNSELECTED_PAINT", colorParser]);
|
|
141
|
+
}
|
|
142
|
+
chosen.delete("sourceArrowColor");
|
|
143
|
+
chosen.delete("targetArrowColor");
|
|
144
|
+
}
|
|
145
|
+
return chosen;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* A mapping with its values read for one property.
|
|
150
|
+
* @category Styles
|
|
151
|
+
*/
|
|
152
|
+
export type ParsedMapping =
|
|
153
|
+
| { readonly kind: "passthrough"; readonly column: string }
|
|
154
|
+
| { readonly kind: "discrete"; readonly column: string; readonly table: readonly (readonly [Scalar, StyleValue])[] }
|
|
155
|
+
| { readonly kind: "continuous"; readonly column: string; readonly points: readonly ContinuousPoint[] };
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Reads a mapping's raw values with a property's parser: table entries and points whose values do not parse are
|
|
159
|
+
* dropped (and noted), points are sorted, and of two points at the same value the later one wins.
|
|
160
|
+
* @param m - the mapping
|
|
161
|
+
* @param parse - the property's parser
|
|
162
|
+
* @param site - where problems are noted
|
|
163
|
+
* @returns the mapping with canonical values
|
|
164
|
+
*/
|
|
165
|
+
export function parseMapping(m: CytoscapeMapping, parse: CytoscapeValueParser, site: CanonSite): ParsedMapping {
|
|
166
|
+
switch (m.kind) {
|
|
167
|
+
case "passthrough":
|
|
168
|
+
return { kind: "passthrough", column: m.column };
|
|
169
|
+
case "discrete": {
|
|
170
|
+
const table: [Scalar, StyleValue][] = [];
|
|
171
|
+
for (const [k, raw] of m.table) {
|
|
172
|
+
const v = parse(raw, site);
|
|
173
|
+
if (v !== null) {
|
|
174
|
+
table.push([k, v]);
|
|
175
|
+
}
|
|
176
|
+
}
|
|
177
|
+
return { kind: "discrete", column: m.column, table };
|
|
178
|
+
}
|
|
179
|
+
default:
|
|
180
|
+
return { kind: "continuous", column: m.column, points: parsePoints(m.points, parse, site) };
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* A continuous mapping's points with canonical values: points whose values do not parse are dropped (and noted),
|
|
186
|
+
* points are sorted, and of two points at the same value the later one wins.
|
|
187
|
+
* @param raw - the points
|
|
188
|
+
* @param parse - the property's parser
|
|
189
|
+
* @param site - where problems are noted
|
|
190
|
+
* @returns the points
|
|
191
|
+
*/
|
|
192
|
+
function parsePoints(
|
|
193
|
+
raw: readonly CytoscapeContinuousPoint[],
|
|
194
|
+
parse: CytoscapeValueParser,
|
|
195
|
+
site: CanonSite,
|
|
196
|
+
): ContinuousPoint[] {
|
|
197
|
+
const parsed: ContinuousPoint[] = [];
|
|
198
|
+
for (const p of raw) {
|
|
199
|
+
const below = parse(p.below, site);
|
|
200
|
+
const value = parse(p.value, site);
|
|
201
|
+
const above = parse(p.above, site);
|
|
202
|
+
if (below !== null && value !== null && above !== null) {
|
|
203
|
+
parsed.push({ at: p.at, below, value, above });
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
parsed.sort((a, b) => a.at - b.at);
|
|
207
|
+
const points: ContinuousPoint[] = [];
|
|
208
|
+
for (const p of parsed) {
|
|
209
|
+
if (points.at(-1)?.at === p.at) {
|
|
210
|
+
points[points.length - 1] = p;
|
|
211
|
+
} else {
|
|
212
|
+
points.push(p);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
return points;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
/**
|
|
219
|
+
* One mapping evaluated for one element's attribute value.
|
|
220
|
+
* @param m - the parsed mapping
|
|
221
|
+
* @param value - the element's value
|
|
222
|
+
* @param parse - the property's parser, for a passthrough
|
|
223
|
+
* @param site - where problems are noted
|
|
224
|
+
* @returns the value, or null when the mapping gives none
|
|
225
|
+
*/
|
|
226
|
+
function evalMapping(
|
|
227
|
+
m: ParsedMapping,
|
|
228
|
+
value: unknown,
|
|
229
|
+
parse: CytoscapeValueParser,
|
|
230
|
+
site: CanonSite,
|
|
231
|
+
): StyleValue | null {
|
|
232
|
+
if (value === null || value === undefined) {
|
|
233
|
+
return null;
|
|
234
|
+
}
|
|
235
|
+
switch (m.kind) {
|
|
236
|
+
case "passthrough":
|
|
237
|
+
return Array.isArray(value) ? null : parse(value, site);
|
|
238
|
+
case "discrete": {
|
|
239
|
+
const j = discreteLookup(m.table)(value);
|
|
240
|
+
return j < 0 ? null : m.table[j][1];
|
|
241
|
+
}
|
|
242
|
+
default:
|
|
243
|
+
return evalContinuous(m.points, numberOf(value));
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
/** The resolver of one target: reads one visual property for one element. */
|
|
248
|
+
interface Resolver {
|
|
249
|
+
readonly bypass: (i: number, vp: string) => unknown;
|
|
250
|
+
readonly one: (vp: string, parse: CytoscapeValueParser, property: string, i: number) => StyleValue | null;
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Builds the per-element reader of one target's style.
|
|
255
|
+
* @param target - nodes or edges
|
|
256
|
+
* @param style - the target's style
|
|
257
|
+
* @param elements - the elements
|
|
258
|
+
* @param notes - where problems are noted
|
|
259
|
+
* @param budget - the work budget
|
|
260
|
+
* @returns the reader
|
|
261
|
+
*/
|
|
262
|
+
function resolver(
|
|
263
|
+
target: StyleTarget,
|
|
264
|
+
style: CytoscapeTargetStyle,
|
|
265
|
+
elements: CytoscapeElements,
|
|
266
|
+
notes: StyleNotes,
|
|
267
|
+
budget: StyleWorkBudget | undefined,
|
|
268
|
+
): Resolver {
|
|
269
|
+
const bypasses = elements.bypasses ?? [];
|
|
270
|
+
const parsed = new Map<string, ParsedMapping>();
|
|
271
|
+
const ruleSite = (property: string): CanonSite => ({ notes, target, property, budget });
|
|
272
|
+
const bypass = (i: number, vp: string): unknown => {
|
|
273
|
+
const b = bypasses[i];
|
|
274
|
+
if (!b) {
|
|
275
|
+
return undefined;
|
|
276
|
+
}
|
|
277
|
+
const v = b.get(vp);
|
|
278
|
+
if (v !== undefined && v !== null) {
|
|
279
|
+
return v;
|
|
280
|
+
}
|
|
281
|
+
for (const [from, to] of style.bypassAliases) {
|
|
282
|
+
if (to === vp && !b.has(to)) {
|
|
283
|
+
return b.get(from);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
return undefined;
|
|
287
|
+
};
|
|
288
|
+
// a mapping parsed once per visual property and neutral property
|
|
289
|
+
const mappingOf = (vp: string, parse: CytoscapeValueParser, property: string): ParsedMapping | undefined => {
|
|
290
|
+
const raw = style.mappings.get(vp);
|
|
291
|
+
if (raw === undefined) {
|
|
292
|
+
return undefined;
|
|
293
|
+
}
|
|
294
|
+
const key = `${vp}\u0000${property}`;
|
|
295
|
+
let m = parsed.get(key);
|
|
296
|
+
if (m === undefined) {
|
|
297
|
+
const entries = raw.kind === "discrete" ? raw.table.length : 0;
|
|
298
|
+
budget?.spend(target, 1 + entries + (raw.kind === "continuous" ? raw.points.length : 0));
|
|
299
|
+
m = parseMapping(raw, parse, ruleSite(property));
|
|
300
|
+
parsed.set(key, m);
|
|
301
|
+
}
|
|
302
|
+
return m;
|
|
303
|
+
};
|
|
304
|
+
const one = (vp: string, parse: CytoscapeValueParser, property: string, i: number): StyleValue | null => {
|
|
305
|
+
const site: CanonSite = { notes, target, property, element: i, budget };
|
|
306
|
+
const b = bypass(i, vp);
|
|
307
|
+
const fromBypass = b === undefined || b === null ? null : parse(b, site);
|
|
308
|
+
if (fromBypass !== null) {
|
|
309
|
+
return fromBypass;
|
|
310
|
+
}
|
|
311
|
+
const m = mappingOf(vp, parse, property);
|
|
312
|
+
const mapped = m === undefined ? null : evalMapping(m, elements.value(m.column, i), parse, site);
|
|
313
|
+
if (mapped !== null) {
|
|
314
|
+
return mapped;
|
|
315
|
+
}
|
|
316
|
+
return style.defaults.has(vp) ? parse(style.defaults.get(vp), ruleSite(property)) : null;
|
|
317
|
+
};
|
|
318
|
+
return { bypass, one };
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
/**
|
|
322
|
+
* Every element's value per neutral property under a Cytoscape style, the way Cytoscape draws it: per visual
|
|
323
|
+
* property a bypass, else the mapping's value, else the default; `nodeSizeLocked` and `arrowColorMatchesEdge`
|
|
324
|
+
* applied. `EDGE_CURVED` only rounds an edge's bends, so an edge without bends is `curved: false`. Visual properties
|
|
325
|
+
* no neutral property carries are noted as `W_STYLE_NOT_CARRIED`.
|
|
326
|
+
* @param target - nodes or edges
|
|
327
|
+
* @param style - the style
|
|
328
|
+
* @param elements - the elements, their attribute values and their bypasses
|
|
329
|
+
* @param options - notes, the budget and whose defaults fill what the style leaves unset
|
|
330
|
+
* @returns per property, each element's value (null where nothing gives one)
|
|
331
|
+
* @category Styles
|
|
332
|
+
*/
|
|
333
|
+
export function resolveCytoscape(
|
|
334
|
+
target: StyleTarget,
|
|
335
|
+
style: CytoscapeStyle,
|
|
336
|
+
elements: CytoscapeElements,
|
|
337
|
+
options: CytoscapeResolveOptions = {},
|
|
338
|
+
): Partial<Record<string, StyleColumn>> {
|
|
339
|
+
const notes = options.notes ?? new StyleNotes();
|
|
340
|
+
const s = style[target];
|
|
341
|
+
const n = elements.count;
|
|
342
|
+
const { used, bypassed } = vpUsage(s, elements.bypasses ?? []);
|
|
343
|
+
const chosen = chooseVps(target, s, used);
|
|
344
|
+
const { one } = resolver(target, s, elements, notes, options.budget);
|
|
345
|
+
const out: Partial<Record<string, StyleColumn>> = {};
|
|
346
|
+
const column = (vp: string, parse: CytoscapeValueParser, property: string): (StyleValue | null)[] => {
|
|
347
|
+
options.budget?.spend(target, n);
|
|
348
|
+
const values = new Array<StyleValue | null>(n);
|
|
349
|
+
for (let i = 0; i < n; i++) {
|
|
350
|
+
values[i] = one(vp, parse, property, i);
|
|
351
|
+
}
|
|
352
|
+
return values;
|
|
353
|
+
};
|
|
354
|
+
for (const [prop, [vp, parse]] of chosen) {
|
|
355
|
+
out[prop] = column(vp, parse, prop);
|
|
356
|
+
}
|
|
357
|
+
if (target === "node" && s.dependencies.get("nodeSizeLocked") === true) {
|
|
358
|
+
const size = column(NODE_SIZE_VP, sizeParser, "width").map((v) => v ?? NODE_SIZE_FALLBACK);
|
|
359
|
+
out.width = size;
|
|
360
|
+
out.height = size.slice();
|
|
361
|
+
}
|
|
362
|
+
if (target === "edge" && s.dependencies.get("arrowColorMatchesEdge") === true && out.color !== undefined) {
|
|
363
|
+
out.sourceArrowColor = out.color.slice();
|
|
364
|
+
out.targetArrowColor = out.color.slice();
|
|
365
|
+
}
|
|
366
|
+
noteUncarried(target, s, used, bypassed, notes);
|
|
367
|
+
fillToolDefaults(target, out, n, options.defaults ?? null);
|
|
368
|
+
if (target === "edge") {
|
|
369
|
+
straightenBendless(out, one);
|
|
370
|
+
}
|
|
371
|
+
return out;
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Marks straight every curved edge without bends: `EDGE_CURVED` only rounds the bends an edge has.
|
|
376
|
+
* @param out - the values per property, changed in place
|
|
377
|
+
* @param one - reads one visual property of one element
|
|
378
|
+
*/
|
|
379
|
+
function straightenBendless(out: Partial<Record<string, StyleColumn>>, one: Resolver["one"]): void {
|
|
380
|
+
const { curved } = out;
|
|
381
|
+
if (curved !== undefined) {
|
|
382
|
+
out.curved = curved.map((c, i) => (c === true ? one(EDGE_BEND_VP, bendParser, "curved", i) === true : c));
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
|
|
386
|
+
/** An edge's bend handles. */
|
|
387
|
+
export const EDGE_BEND_VP = "EDGE_BEND";
|
|
388
|
+
|
|
389
|
+
/**
|
|
390
|
+
* Whether an `EDGE_BEND` value holds any handle: Cytoscape writes an edge without bends as an empty string.
|
|
391
|
+
* @param raw - the value
|
|
392
|
+
* @returns true when the edge bends
|
|
393
|
+
*/
|
|
394
|
+
export const bendParser: CytoscapeValueParser = (raw) => {
|
|
395
|
+
if (typeof raw === "string") {
|
|
396
|
+
const text = raw.trim();
|
|
397
|
+
return text !== "" && text !== '""';
|
|
398
|
+
}
|
|
399
|
+
return Array.isArray(raw) ? raw.length > 0 : raw !== null && raw !== undefined && typeof raw === "object";
|
|
400
|
+
};
|
|
401
|
+
|
|
402
|
+
/** Default values that mean "nothing drawn": a VP left at one of these is not worth a note. */
|
|
403
|
+
const INERT_DEFAULT = /NullCustomGraphics|^255$|^0(?:\.0+)?$|^$|^C,C,c,0\.00,0\.00$|^false$/;
|
|
404
|
+
|
|
405
|
+
/**
|
|
406
|
+
* Notes every visual property the style uses that no neutral property carries.
|
|
407
|
+
* @param target - nodes or edges
|
|
408
|
+
* @param s - the target's style
|
|
409
|
+
* @param used - the visual properties used anywhere
|
|
410
|
+
* @param bypassed - those used by a bypass
|
|
411
|
+
* @param notes - where to note
|
|
412
|
+
*/
|
|
413
|
+
function noteUncarried(
|
|
414
|
+
target: StyleTarget,
|
|
415
|
+
s: CytoscapeTargetStyle,
|
|
416
|
+
used: ReadonlySet<string>,
|
|
417
|
+
bypassed: ReadonlySet<string>,
|
|
418
|
+
notes: StyleNotes,
|
|
419
|
+
): void {
|
|
420
|
+
for (const vp of used) {
|
|
421
|
+
if (!isUncarriedVp(vp)) {
|
|
422
|
+
continue;
|
|
423
|
+
}
|
|
424
|
+
const d = s.defaults.get(vp);
|
|
425
|
+
const text = typeof d === "string" || typeof d === "number" || typeof d === "boolean" ? String(d) : "";
|
|
426
|
+
if (INERT_DEFAULT.test(text.slice(0, 64)) && !s.mappings.has(vp) && !bypassed.has(vp)) {
|
|
427
|
+
continue;
|
|
428
|
+
}
|
|
429
|
+
notes.add(STYLE_ISSUE.NOT_CARRIED, target, vp, { sample: text });
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Fills what nothing gave with a tool's defaults.
|
|
435
|
+
* @param target - nodes or edges
|
|
436
|
+
* @param out - the values per property
|
|
437
|
+
* @param n - the element count
|
|
438
|
+
* @param tool - the tool, or null for none
|
|
439
|
+
*/
|
|
440
|
+
function fillToolDefaults(
|
|
441
|
+
target: StyleTarget,
|
|
442
|
+
out: Partial<Record<string, StyleColumn>>,
|
|
443
|
+
n: number,
|
|
444
|
+
tool: StyleTool | null,
|
|
445
|
+
): void {
|
|
446
|
+
const d = tool === null ? null : toolDefaults(tool);
|
|
447
|
+
if (d === null) {
|
|
448
|
+
return;
|
|
449
|
+
}
|
|
450
|
+
for (const [prop, entry] of Object.entries(d[target]) as [string, { value: unknown } | undefined][]) {
|
|
451
|
+
if (entry === undefined || !isStyleValue(target, prop, entry.value)) {
|
|
452
|
+
continue;
|
|
453
|
+
}
|
|
454
|
+
const value = entry.value as StyleValue;
|
|
455
|
+
const values = out[prop] === undefined ? new Array<StyleValue | null>(n).fill(null) : out[prop].slice();
|
|
456
|
+
for (let i = 0; i < n; i++) {
|
|
457
|
+
values[i] ??= value;
|
|
458
|
+
}
|
|
459
|
+
out[prop] = values;
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/**
|
|
464
|
+
* The style's network background color (`NETWORK_BACKGROUND_PAINT`, CX2's `NETWORK_BACKGROUND_COLOR`).
|
|
465
|
+
* @param style - the style
|
|
466
|
+
* @param notes - where a bad value is noted
|
|
467
|
+
* @returns the color, or null
|
|
468
|
+
* @category Styles
|
|
469
|
+
*/
|
|
470
|
+
export function cytoscapeBackground(style: CytoscapeStyle, notes?: StyleNotes): StyleColor | null {
|
|
471
|
+
const d = style.network.defaults;
|
|
472
|
+
const raw = d.get("NETWORK_BACKGROUND_PAINT") ?? d.get("NETWORK_BACKGROUND_COLOR");
|
|
473
|
+
if (raw === undefined) {
|
|
474
|
+
return null;
|
|
475
|
+
}
|
|
476
|
+
const v = colorParser(raw, { notes: notes ?? new StyleNotes(), target: "graph", property: "background" });
|
|
477
|
+
return typeof v === "string" ? (v as StyleColor) : null;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
/**
|
|
481
|
+
* Every element's values when each element carries its own resolved visual properties and no style (XGMML files
|
|
482
|
+
* and Cytoscape 2.x sessions). Width and height are read from `NODE_SIZE` when no element states them; keys with no
|
|
483
|
+
* visual property name (`?<key>` from `normalizeVisualProperties()`) are noted as `W_STYLE_NOT_CARRIED`.
|
|
484
|
+
* @param target - nodes or edges
|
|
485
|
+
* @param maps - each element's visual properties
|
|
486
|
+
* @param options - notes, the budget and whose defaults fill what is unset
|
|
487
|
+
* @returns per property, each element's value
|
|
488
|
+
* @category Styles
|
|
489
|
+
*/
|
|
490
|
+
export function resolveCytoscapeBypasses(
|
|
491
|
+
target: StyleTarget,
|
|
492
|
+
maps: readonly CytoscapeBypass[],
|
|
493
|
+
options: CytoscapeResolveOptions = {},
|
|
494
|
+
): Partial<Record<string, StyleColumn>> {
|
|
495
|
+
const notes = options.notes ?? new StyleNotes();
|
|
496
|
+
const style = emptyCytoscapeStyle();
|
|
497
|
+
const elements: CytoscapeElements = { count: maps.length, value: () => null, bypasses: maps };
|
|
498
|
+
const out = resolveCytoscape(target, style, elements, { notes, budget: options.budget });
|
|
499
|
+
if (target === "node" && out.width === undefined) {
|
|
500
|
+
const size = maps.map((m) => {
|
|
501
|
+
const raw = m?.get(NODE_SIZE_VP);
|
|
502
|
+
return raw === undefined ? null : sizeParser(raw, { notes, target, property: "width" });
|
|
503
|
+
});
|
|
504
|
+
if (size.some((v) => v !== null)) {
|
|
505
|
+
out.width = size;
|
|
506
|
+
out.height = size.slice();
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
for (const m of maps) {
|
|
510
|
+
if (!m) {
|
|
511
|
+
continue;
|
|
512
|
+
}
|
|
513
|
+
for (const [k, v] of m) {
|
|
514
|
+
if (k.startsWith("?")) {
|
|
515
|
+
notes.add(STYLE_ISSUE.NOT_CARRIED, target, k.slice(1), { sample: v });
|
|
516
|
+
}
|
|
517
|
+
}
|
|
518
|
+
}
|
|
519
|
+
fillToolDefaults(target, out, maps.length, options.defaults ?? null);
|
|
520
|
+
return out;
|
|
521
|
+
}
|