@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,137 @@
|
|
|
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
|
+
import type { CanonSite } from "../canon/site.js";
|
|
8
|
+
import { StyleNotes } from "../notes.js";
|
|
9
|
+
import type { ContinuousPoint, Scalar, StyleColor, StyleColumn, StyleTarget, StyleTool, StyleValue, StyleWorkBudget } from "../types.js";
|
|
10
|
+
import { type CytoscapeValueParser } from "./lexicon.js";
|
|
11
|
+
import { type CytoscapeMapping, type CytoscapeStyle, type CytoscapeTargetStyle } from "./mappings.js";
|
|
12
|
+
/**
|
|
13
|
+
* One element's bypasses: visual property name to raw value; null or undefined when it has none.
|
|
14
|
+
* @category Styles
|
|
15
|
+
*/
|
|
16
|
+
export type CytoscapeBypass = ReadonlyMap<string, unknown> | null | undefined;
|
|
17
|
+
/**
|
|
18
|
+
* The elements of one target a style is resolved over.
|
|
19
|
+
* @category Styles
|
|
20
|
+
*/
|
|
21
|
+
export interface CytoscapeElements {
|
|
22
|
+
/** How many elements there are. */
|
|
23
|
+
readonly count: number;
|
|
24
|
+
/**
|
|
25
|
+
* An element's value of an attribute column (a list attribute as an array), or null.
|
|
26
|
+
* @param column - the column's name
|
|
27
|
+
* @param i - the element index
|
|
28
|
+
* @returns the value
|
|
29
|
+
*/
|
|
30
|
+
value(column: string, i: number): unknown;
|
|
31
|
+
/** Each element's bypasses, by element index. */
|
|
32
|
+
readonly bypasses?: readonly CytoscapeBypass[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Options of `resolveCytoscape()`.
|
|
36
|
+
* @category Styles
|
|
37
|
+
*/
|
|
38
|
+
export interface CytoscapeResolveOptions {
|
|
39
|
+
/** Where problems are noted. */
|
|
40
|
+
readonly notes?: StyleNotes;
|
|
41
|
+
/** The counted work budget. */
|
|
42
|
+
readonly budget?: StyleWorkBudget;
|
|
43
|
+
/**
|
|
44
|
+
* Whose defaults fill what the style leaves unset: `"cytoscape"` (the desktop's default visual style, for CX,
|
|
45
|
+
* CX2 and XGMML), `"cytoscape-fallbacks"` (the renderer's fallbacks, for sessions) or null for none, so an
|
|
46
|
+
* element the style says nothing about is null. Defaults to null.
|
|
47
|
+
*/
|
|
48
|
+
readonly defaults?: StyleTool | null;
|
|
49
|
+
}
|
|
50
|
+
/** A visual property and the parser that reads it for one neutral property. */
|
|
51
|
+
type VpChoice = readonly [vp: string, parse: CytoscapeValueParser];
|
|
52
|
+
/**
|
|
53
|
+
* Which visual properties a style or its bypasses mention.
|
|
54
|
+
* @param style - the target's style
|
|
55
|
+
* @param bypasses - the elements' bypasses
|
|
56
|
+
* @returns the names used anywhere, and those used by a bypass
|
|
57
|
+
*/
|
|
58
|
+
export declare function vpUsage(style: CytoscapeTargetStyle, bypasses: readonly CytoscapeBypass[]): {
|
|
59
|
+
used: Set<string>;
|
|
60
|
+
bypassed: Set<string>;
|
|
61
|
+
};
|
|
62
|
+
/**
|
|
63
|
+
* Which visual property sets each neutral property: the first of its lexicon list the style or any bypass
|
|
64
|
+
* mentions, with the dependencies applied.
|
|
65
|
+
* @param target - nodes or edges
|
|
66
|
+
* @param style - the target's style
|
|
67
|
+
* @param used - the visual properties used anywhere
|
|
68
|
+
* @returns property to its visual property and parser
|
|
69
|
+
*/
|
|
70
|
+
export declare function chooseVps(target: StyleTarget, style: CytoscapeTargetStyle, used: ReadonlySet<string>): Map<string, VpChoice>;
|
|
71
|
+
/**
|
|
72
|
+
* A mapping with its values read for one property.
|
|
73
|
+
* @category Styles
|
|
74
|
+
*/
|
|
75
|
+
export type ParsedMapping = {
|
|
76
|
+
readonly kind: "passthrough";
|
|
77
|
+
readonly column: string;
|
|
78
|
+
} | {
|
|
79
|
+
readonly kind: "discrete";
|
|
80
|
+
readonly column: string;
|
|
81
|
+
readonly table: readonly (readonly [Scalar, StyleValue])[];
|
|
82
|
+
} | {
|
|
83
|
+
readonly kind: "continuous";
|
|
84
|
+
readonly column: string;
|
|
85
|
+
readonly points: readonly ContinuousPoint[];
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Reads a mapping's raw values with a property's parser: table entries and points whose values do not parse are
|
|
89
|
+
* dropped (and noted), points are sorted, and of two points at the same value the later one wins.
|
|
90
|
+
* @param m - the mapping
|
|
91
|
+
* @param parse - the property's parser
|
|
92
|
+
* @param site - where problems are noted
|
|
93
|
+
* @returns the mapping with canonical values
|
|
94
|
+
*/
|
|
95
|
+
export declare function parseMapping(m: CytoscapeMapping, parse: CytoscapeValueParser, site: CanonSite): ParsedMapping;
|
|
96
|
+
/**
|
|
97
|
+
* Every element's value per neutral property under a Cytoscape style, the way Cytoscape draws it: per visual
|
|
98
|
+
* property a bypass, else the mapping's value, else the default; `nodeSizeLocked` and `arrowColorMatchesEdge`
|
|
99
|
+
* applied. `EDGE_CURVED` only rounds an edge's bends, so an edge without bends is `curved: false`. Visual properties
|
|
100
|
+
* no neutral property carries are noted as `W_STYLE_NOT_CARRIED`.
|
|
101
|
+
* @param target - nodes or edges
|
|
102
|
+
* @param style - the style
|
|
103
|
+
* @param elements - the elements, their attribute values and their bypasses
|
|
104
|
+
* @param options - notes, the budget and whose defaults fill what the style leaves unset
|
|
105
|
+
* @returns per property, each element's value (null where nothing gives one)
|
|
106
|
+
* @category Styles
|
|
107
|
+
*/
|
|
108
|
+
export declare function resolveCytoscape(target: StyleTarget, style: CytoscapeStyle, elements: CytoscapeElements, options?: CytoscapeResolveOptions): Partial<Record<string, StyleColumn>>;
|
|
109
|
+
/** An edge's bend handles. */
|
|
110
|
+
export declare const EDGE_BEND_VP = "EDGE_BEND";
|
|
111
|
+
/**
|
|
112
|
+
* Whether an `EDGE_BEND` value holds any handle: Cytoscape writes an edge without bends as an empty string.
|
|
113
|
+
* @param raw - the value
|
|
114
|
+
* @returns true when the edge bends
|
|
115
|
+
*/
|
|
116
|
+
export declare const bendParser: CytoscapeValueParser;
|
|
117
|
+
/**
|
|
118
|
+
* The style's network background color (`NETWORK_BACKGROUND_PAINT`, CX2's `NETWORK_BACKGROUND_COLOR`).
|
|
119
|
+
* @param style - the style
|
|
120
|
+
* @param notes - where a bad value is noted
|
|
121
|
+
* @returns the color, or null
|
|
122
|
+
* @category Styles
|
|
123
|
+
*/
|
|
124
|
+
export declare function cytoscapeBackground(style: CytoscapeStyle, notes?: StyleNotes): StyleColor | null;
|
|
125
|
+
/**
|
|
126
|
+
* Every element's values when each element carries its own resolved visual properties and no style (XGMML files
|
|
127
|
+
* and Cytoscape 2.x sessions). Width and height are read from `NODE_SIZE` when no element states them; keys with no
|
|
128
|
+
* visual property name (`?<key>` from `normalizeVisualProperties()`) are noted as `W_STYLE_NOT_CARRIED`.
|
|
129
|
+
* @param target - nodes or edges
|
|
130
|
+
* @param maps - each element's visual properties
|
|
131
|
+
* @param options - notes, the budget and whose defaults fill what is unset
|
|
132
|
+
* @returns per property, each element's value
|
|
133
|
+
* @category Styles
|
|
134
|
+
*/
|
|
135
|
+
export declare function resolveCytoscapeBypasses(target: StyleTarget, maps: readonly CytoscapeBypass[], options?: CytoscapeResolveOptions): Partial<Record<string, StyleColumn>>;
|
|
136
|
+
export {};
|
|
137
|
+
//# sourceMappingURL=resolve.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.d.ts","sourceRoot":"","sources":["../../../../src/styles/cytoscape/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EACR,eAAe,EACf,MAAM,EACN,UAAU,EACV,WAAW,EACX,WAAW,EACX,SAAS,EACT,UAAU,EACV,eAAe,EAClB,MAAM,aAAa,CAAC;AAErB,OAAO,EAGH,KAAK,oBAAoB,EAI5B,MAAM,cAAc,CAAC;AACtB,OAAO,EAEH,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAE5B,MAAM,eAAe,CAAC;AAEvB;;;GAGG;AACH,MAAM,MAAM,eAAe,GAAG,WAAW,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,GAAG,SAAS,CAAC;AAE9E;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAC9B,mCAAmC;IACnC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB;;;;;OAKG;IACH,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1C,iDAAiD;IACjD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,eAAe,EAAE,CAAC;CAClD;AAED;;;GAGG;AACH,MAAM,WAAW,uBAAuB;IACpC,gCAAgC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IA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AE,oBAAoB,EAAE,IAAI,EAAE,SAAS,GAAG,aAAa,CAiB7G;AA2ID;;;;;;;;;;;GAWG;AACH,wBAAgB,gBAAgB,CAC5B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE,uBAA4B,GACtC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CAkCtC;AAcD,8BAA8B;AAC9B,eAAO,MAAM,YAAY,cAAc,CAAC;AAExC;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,oBAMxB,CAAC;AA+DF;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,cAAc,EAAE,KAAK,CAAC,EAAE,UAAU,GAAG,UAAU,GAAG,IAAI,CAQhG;AAED;;;;;;;;;GASG;AACH,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,WAAW,EACnB,IAAI,EAAE,SAAS,eAAe,EAAE,EAChC,OAAO,GAAE,uBAA4B,GACtC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC,CA2BtC"}
|
|
@@ -0,0 +1,381 @@
|
|
|
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
|
+
import { STYLE_ISSUE } from "../codes.js";
|
|
8
|
+
import { toolDefaults } from "../defaults.js";
|
|
9
|
+
import { StyleNotes } from "../notes.js";
|
|
10
|
+
import { discreteLookup, evalContinuous, numberOf } from "../plan/resolve.js";
|
|
11
|
+
import { isStyleValue } from "../vocabulary.js";
|
|
12
|
+
import { colorParser, CYTOSCAPE_LEXICON, isUncarriedVp, NODE_SIZE_VP, sizeParser, } from "./lexicon.js";
|
|
13
|
+
import { emptyCytoscapeStyle, } from "./mappings.js";
|
|
14
|
+
/** Locked node sizes with no `NODE_SIZE` anywhere draw at Cytoscape's lexicon default. */
|
|
15
|
+
const NODE_SIZE_FALLBACK = 50;
|
|
16
|
+
/**
|
|
17
|
+
* Which visual properties a style or its bypasses mention.
|
|
18
|
+
* @param style - the target's style
|
|
19
|
+
* @param bypasses - the elements' bypasses
|
|
20
|
+
* @returns the names used anywhere, and those used by a bypass
|
|
21
|
+
*/
|
|
22
|
+
export function vpUsage(style, bypasses) {
|
|
23
|
+
const bypassed = new Set();
|
|
24
|
+
for (const b of bypasses) {
|
|
25
|
+
if (b) {
|
|
26
|
+
for (const k of b.keys()) {
|
|
27
|
+
bypassed.add(k);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
for (const [from, to] of style.bypassAliases) {
|
|
32
|
+
if (bypassed.has(from)) {
|
|
33
|
+
bypassed.add(to);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const used = new Set([...style.defaults.keys(), ...style.mappings.keys(), ...bypassed]);
|
|
37
|
+
return { used, bypassed };
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Which visual property sets each neutral property: the first of its lexicon list the style or any bypass
|
|
41
|
+
* mentions, with the dependencies applied.
|
|
42
|
+
* @param target - nodes or edges
|
|
43
|
+
* @param style - the target's style
|
|
44
|
+
* @param used - the visual properties used anywhere
|
|
45
|
+
* @returns property to its visual property and parser
|
|
46
|
+
*/
|
|
47
|
+
export function chooseVps(target, style, used) {
|
|
48
|
+
const chosen = new Map();
|
|
49
|
+
for (const [prop, list] of CYTOSCAPE_LEXICON[target]) {
|
|
50
|
+
const hit = list.find(([vp]) => used.has(vp));
|
|
51
|
+
if (hit !== undefined) {
|
|
52
|
+
chosen.set(prop, hit);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (target === "node" && style.dependencies.get("nodeSizeLocked") === true) {
|
|
56
|
+
chosen.delete("width");
|
|
57
|
+
chosen.delete("height");
|
|
58
|
+
}
|
|
59
|
+
if (target === "edge" && style.dependencies.get("arrowColorMatchesEdge") === true) {
|
|
60
|
+
if (used.has("EDGE_UNSELECTED_PAINT")) {
|
|
61
|
+
chosen.set("color", ["EDGE_UNSELECTED_PAINT", colorParser]);
|
|
62
|
+
}
|
|
63
|
+
chosen.delete("sourceArrowColor");
|
|
64
|
+
chosen.delete("targetArrowColor");
|
|
65
|
+
}
|
|
66
|
+
return chosen;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Reads a mapping's raw values with a property's parser: table entries and points whose values do not parse are
|
|
70
|
+
* dropped (and noted), points are sorted, and of two points at the same value the later one wins.
|
|
71
|
+
* @param m - the mapping
|
|
72
|
+
* @param parse - the property's parser
|
|
73
|
+
* @param site - where problems are noted
|
|
74
|
+
* @returns the mapping with canonical values
|
|
75
|
+
*/
|
|
76
|
+
export function parseMapping(m, parse, site) {
|
|
77
|
+
switch (m.kind) {
|
|
78
|
+
case "passthrough":
|
|
79
|
+
return { kind: "passthrough", column: m.column };
|
|
80
|
+
case "discrete": {
|
|
81
|
+
const table = [];
|
|
82
|
+
for (const [k, raw] of m.table) {
|
|
83
|
+
const v = parse(raw, site);
|
|
84
|
+
if (v !== null) {
|
|
85
|
+
table.push([k, v]);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
return { kind: "discrete", column: m.column, table };
|
|
89
|
+
}
|
|
90
|
+
default:
|
|
91
|
+
return { kind: "continuous", column: m.column, points: parsePoints(m.points, parse, site) };
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* A continuous mapping's points with canonical values: points whose values do not parse are dropped (and noted),
|
|
96
|
+
* points are sorted, and of two points at the same value the later one wins.
|
|
97
|
+
* @param raw - the points
|
|
98
|
+
* @param parse - the property's parser
|
|
99
|
+
* @param site - where problems are noted
|
|
100
|
+
* @returns the points
|
|
101
|
+
*/
|
|
102
|
+
function parsePoints(raw, parse, site) {
|
|
103
|
+
const parsed = [];
|
|
104
|
+
for (const p of raw) {
|
|
105
|
+
const below = parse(p.below, site);
|
|
106
|
+
const value = parse(p.value, site);
|
|
107
|
+
const above = parse(p.above, site);
|
|
108
|
+
if (below !== null && value !== null && above !== null) {
|
|
109
|
+
parsed.push({ at: p.at, below, value, above });
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
parsed.sort((a, b) => a.at - b.at);
|
|
113
|
+
const points = [];
|
|
114
|
+
for (const p of parsed) {
|
|
115
|
+
if (points.at(-1)?.at === p.at) {
|
|
116
|
+
points[points.length - 1] = p;
|
|
117
|
+
}
|
|
118
|
+
else {
|
|
119
|
+
points.push(p);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return points;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* One mapping evaluated for one element's attribute value.
|
|
126
|
+
* @param m - the parsed mapping
|
|
127
|
+
* @param value - the element's value
|
|
128
|
+
* @param parse - the property's parser, for a passthrough
|
|
129
|
+
* @param site - where problems are noted
|
|
130
|
+
* @returns the value, or null when the mapping gives none
|
|
131
|
+
*/
|
|
132
|
+
function evalMapping(m, value, parse, site) {
|
|
133
|
+
if (value === null || value === undefined) {
|
|
134
|
+
return null;
|
|
135
|
+
}
|
|
136
|
+
switch (m.kind) {
|
|
137
|
+
case "passthrough":
|
|
138
|
+
return Array.isArray(value) ? null : parse(value, site);
|
|
139
|
+
case "discrete": {
|
|
140
|
+
const j = discreteLookup(m.table)(value);
|
|
141
|
+
return j < 0 ? null : m.table[j][1];
|
|
142
|
+
}
|
|
143
|
+
default:
|
|
144
|
+
return evalContinuous(m.points, numberOf(value));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
/**
|
|
148
|
+
* Builds the per-element reader of one target's style.
|
|
149
|
+
* @param target - nodes or edges
|
|
150
|
+
* @param style - the target's style
|
|
151
|
+
* @param elements - the elements
|
|
152
|
+
* @param notes - where problems are noted
|
|
153
|
+
* @param budget - the work budget
|
|
154
|
+
* @returns the reader
|
|
155
|
+
*/
|
|
156
|
+
function resolver(target, style, elements, notes, budget) {
|
|
157
|
+
const bypasses = elements.bypasses ?? [];
|
|
158
|
+
const parsed = new Map();
|
|
159
|
+
const ruleSite = (property) => ({ notes, target, property, budget });
|
|
160
|
+
const bypass = (i, vp) => {
|
|
161
|
+
const b = bypasses[i];
|
|
162
|
+
if (!b) {
|
|
163
|
+
return undefined;
|
|
164
|
+
}
|
|
165
|
+
const v = b.get(vp);
|
|
166
|
+
if (v !== undefined && v !== null) {
|
|
167
|
+
return v;
|
|
168
|
+
}
|
|
169
|
+
for (const [from, to] of style.bypassAliases) {
|
|
170
|
+
if (to === vp && !b.has(to)) {
|
|
171
|
+
return b.get(from);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
return undefined;
|
|
175
|
+
};
|
|
176
|
+
// a mapping parsed once per visual property and neutral property
|
|
177
|
+
const mappingOf = (vp, parse, property) => {
|
|
178
|
+
const raw = style.mappings.get(vp);
|
|
179
|
+
if (raw === undefined) {
|
|
180
|
+
return undefined;
|
|
181
|
+
}
|
|
182
|
+
const key = `${vp}\u0000${property}`;
|
|
183
|
+
let m = parsed.get(key);
|
|
184
|
+
if (m === undefined) {
|
|
185
|
+
const entries = raw.kind === "discrete" ? raw.table.length : 0;
|
|
186
|
+
budget?.spend(target, 1 + entries + (raw.kind === "continuous" ? raw.points.length : 0));
|
|
187
|
+
m = parseMapping(raw, parse, ruleSite(property));
|
|
188
|
+
parsed.set(key, m);
|
|
189
|
+
}
|
|
190
|
+
return m;
|
|
191
|
+
};
|
|
192
|
+
const one = (vp, parse, property, i) => {
|
|
193
|
+
const site = { notes, target, property, element: i, budget };
|
|
194
|
+
const b = bypass(i, vp);
|
|
195
|
+
const fromBypass = b === undefined || b === null ? null : parse(b, site);
|
|
196
|
+
if (fromBypass !== null) {
|
|
197
|
+
return fromBypass;
|
|
198
|
+
}
|
|
199
|
+
const m = mappingOf(vp, parse, property);
|
|
200
|
+
const mapped = m === undefined ? null : evalMapping(m, elements.value(m.column, i), parse, site);
|
|
201
|
+
if (mapped !== null) {
|
|
202
|
+
return mapped;
|
|
203
|
+
}
|
|
204
|
+
return style.defaults.has(vp) ? parse(style.defaults.get(vp), ruleSite(property)) : null;
|
|
205
|
+
};
|
|
206
|
+
return { bypass, one };
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Every element's value per neutral property under a Cytoscape style, the way Cytoscape draws it: per visual
|
|
210
|
+
* property a bypass, else the mapping's value, else the default; `nodeSizeLocked` and `arrowColorMatchesEdge`
|
|
211
|
+
* applied. `EDGE_CURVED` only rounds an edge's bends, so an edge without bends is `curved: false`. Visual properties
|
|
212
|
+
* no neutral property carries are noted as `W_STYLE_NOT_CARRIED`.
|
|
213
|
+
* @param target - nodes or edges
|
|
214
|
+
* @param style - the style
|
|
215
|
+
* @param elements - the elements, their attribute values and their bypasses
|
|
216
|
+
* @param options - notes, the budget and whose defaults fill what the style leaves unset
|
|
217
|
+
* @returns per property, each element's value (null where nothing gives one)
|
|
218
|
+
* @category Styles
|
|
219
|
+
*/
|
|
220
|
+
export function resolveCytoscape(target, style, elements, options = {}) {
|
|
221
|
+
const notes = options.notes ?? new StyleNotes();
|
|
222
|
+
const s = style[target];
|
|
223
|
+
const n = elements.count;
|
|
224
|
+
const { used, bypassed } = vpUsage(s, elements.bypasses ?? []);
|
|
225
|
+
const chosen = chooseVps(target, s, used);
|
|
226
|
+
const { one } = resolver(target, s, elements, notes, options.budget);
|
|
227
|
+
const out = {};
|
|
228
|
+
const column = (vp, parse, property) => {
|
|
229
|
+
options.budget?.spend(target, n);
|
|
230
|
+
const values = new Array(n);
|
|
231
|
+
for (let i = 0; i < n; i++) {
|
|
232
|
+
values[i] = one(vp, parse, property, i);
|
|
233
|
+
}
|
|
234
|
+
return values;
|
|
235
|
+
};
|
|
236
|
+
for (const [prop, [vp, parse]] of chosen) {
|
|
237
|
+
out[prop] = column(vp, parse, prop);
|
|
238
|
+
}
|
|
239
|
+
if (target === "node" && s.dependencies.get("nodeSizeLocked") === true) {
|
|
240
|
+
const size = column(NODE_SIZE_VP, sizeParser, "width").map((v) => v ?? NODE_SIZE_FALLBACK);
|
|
241
|
+
out.width = size;
|
|
242
|
+
out.height = size.slice();
|
|
243
|
+
}
|
|
244
|
+
if (target === "edge" && s.dependencies.get("arrowColorMatchesEdge") === true && out.color !== undefined) {
|
|
245
|
+
out.sourceArrowColor = out.color.slice();
|
|
246
|
+
out.targetArrowColor = out.color.slice();
|
|
247
|
+
}
|
|
248
|
+
noteUncarried(target, s, used, bypassed, notes);
|
|
249
|
+
fillToolDefaults(target, out, n, options.defaults ?? null);
|
|
250
|
+
if (target === "edge") {
|
|
251
|
+
straightenBendless(out, one);
|
|
252
|
+
}
|
|
253
|
+
return out;
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* Marks straight every curved edge without bends: `EDGE_CURVED` only rounds the bends an edge has.
|
|
257
|
+
* @param out - the values per property, changed in place
|
|
258
|
+
* @param one - reads one visual property of one element
|
|
259
|
+
*/
|
|
260
|
+
function straightenBendless(out, one) {
|
|
261
|
+
const { curved } = out;
|
|
262
|
+
if (curved !== undefined) {
|
|
263
|
+
out.curved = curved.map((c, i) => (c === true ? one(EDGE_BEND_VP, bendParser, "curved", i) === true : c));
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
/** An edge's bend handles. */
|
|
267
|
+
export const EDGE_BEND_VP = "EDGE_BEND";
|
|
268
|
+
/**
|
|
269
|
+
* Whether an `EDGE_BEND` value holds any handle: Cytoscape writes an edge without bends as an empty string.
|
|
270
|
+
* @param raw - the value
|
|
271
|
+
* @returns true when the edge bends
|
|
272
|
+
*/
|
|
273
|
+
export const bendParser = (raw) => {
|
|
274
|
+
if (typeof raw === "string") {
|
|
275
|
+
const text = raw.trim();
|
|
276
|
+
return text !== "" && text !== '""';
|
|
277
|
+
}
|
|
278
|
+
return Array.isArray(raw) ? raw.length > 0 : raw !== null && raw !== undefined && typeof raw === "object";
|
|
279
|
+
};
|
|
280
|
+
/** Default values that mean "nothing drawn": a VP left at one of these is not worth a note. */
|
|
281
|
+
const INERT_DEFAULT = /NullCustomGraphics|^255$|^0(?:\.0+)?$|^$|^C,C,c,0\.00,0\.00$|^false$/;
|
|
282
|
+
/**
|
|
283
|
+
* Notes every visual property the style uses that no neutral property carries.
|
|
284
|
+
* @param target - nodes or edges
|
|
285
|
+
* @param s - the target's style
|
|
286
|
+
* @param used - the visual properties used anywhere
|
|
287
|
+
* @param bypassed - those used by a bypass
|
|
288
|
+
* @param notes - where to note
|
|
289
|
+
*/
|
|
290
|
+
function noteUncarried(target, s, used, bypassed, notes) {
|
|
291
|
+
for (const vp of used) {
|
|
292
|
+
if (!isUncarriedVp(vp)) {
|
|
293
|
+
continue;
|
|
294
|
+
}
|
|
295
|
+
const d = s.defaults.get(vp);
|
|
296
|
+
const text = typeof d === "string" || typeof d === "number" || typeof d === "boolean" ? String(d) : "";
|
|
297
|
+
if (INERT_DEFAULT.test(text.slice(0, 64)) && !s.mappings.has(vp) && !bypassed.has(vp)) {
|
|
298
|
+
continue;
|
|
299
|
+
}
|
|
300
|
+
notes.add(STYLE_ISSUE.NOT_CARRIED, target, vp, { sample: text });
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Fills what nothing gave with a tool's defaults.
|
|
305
|
+
* @param target - nodes or edges
|
|
306
|
+
* @param out - the values per property
|
|
307
|
+
* @param n - the element count
|
|
308
|
+
* @param tool - the tool, or null for none
|
|
309
|
+
*/
|
|
310
|
+
function fillToolDefaults(target, out, n, tool) {
|
|
311
|
+
const d = tool === null ? null : toolDefaults(tool);
|
|
312
|
+
if (d === null) {
|
|
313
|
+
return;
|
|
314
|
+
}
|
|
315
|
+
for (const [prop, entry] of Object.entries(d[target])) {
|
|
316
|
+
if (entry === undefined || !isStyleValue(target, prop, entry.value)) {
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
const value = entry.value;
|
|
320
|
+
const values = out[prop] === undefined ? new Array(n).fill(null) : out[prop].slice();
|
|
321
|
+
for (let i = 0; i < n; i++) {
|
|
322
|
+
values[i] ?? (values[i] = value);
|
|
323
|
+
}
|
|
324
|
+
out[prop] = values;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* The style's network background color (`NETWORK_BACKGROUND_PAINT`, CX2's `NETWORK_BACKGROUND_COLOR`).
|
|
329
|
+
* @param style - the style
|
|
330
|
+
* @param notes - where a bad value is noted
|
|
331
|
+
* @returns the color, or null
|
|
332
|
+
* @category Styles
|
|
333
|
+
*/
|
|
334
|
+
export function cytoscapeBackground(style, notes) {
|
|
335
|
+
const d = style.network.defaults;
|
|
336
|
+
const raw = d.get("NETWORK_BACKGROUND_PAINT") ?? d.get("NETWORK_BACKGROUND_COLOR");
|
|
337
|
+
if (raw === undefined) {
|
|
338
|
+
return null;
|
|
339
|
+
}
|
|
340
|
+
const v = colorParser(raw, { notes: notes ?? new StyleNotes(), target: "graph", property: "background" });
|
|
341
|
+
return typeof v === "string" ? v : null;
|
|
342
|
+
}
|
|
343
|
+
/**
|
|
344
|
+
* Every element's values when each element carries its own resolved visual properties and no style (XGMML files
|
|
345
|
+
* and Cytoscape 2.x sessions). Width and height are read from `NODE_SIZE` when no element states them; keys with no
|
|
346
|
+
* visual property name (`?<key>` from `normalizeVisualProperties()`) are noted as `W_STYLE_NOT_CARRIED`.
|
|
347
|
+
* @param target - nodes or edges
|
|
348
|
+
* @param maps - each element's visual properties
|
|
349
|
+
* @param options - notes, the budget and whose defaults fill what is unset
|
|
350
|
+
* @returns per property, each element's value
|
|
351
|
+
* @category Styles
|
|
352
|
+
*/
|
|
353
|
+
export function resolveCytoscapeBypasses(target, maps, options = {}) {
|
|
354
|
+
const notes = options.notes ?? new StyleNotes();
|
|
355
|
+
const style = emptyCytoscapeStyle();
|
|
356
|
+
const elements = { count: maps.length, value: () => null, bypasses: maps };
|
|
357
|
+
const out = resolveCytoscape(target, style, elements, { notes, budget: options.budget });
|
|
358
|
+
if (target === "node" && out.width === undefined) {
|
|
359
|
+
const size = maps.map((m) => {
|
|
360
|
+
const raw = m?.get(NODE_SIZE_VP);
|
|
361
|
+
return raw === undefined ? null : sizeParser(raw, { notes, target, property: "width" });
|
|
362
|
+
});
|
|
363
|
+
if (size.some((v) => v !== null)) {
|
|
364
|
+
out.width = size;
|
|
365
|
+
out.height = size.slice();
|
|
366
|
+
}
|
|
367
|
+
}
|
|
368
|
+
for (const m of maps) {
|
|
369
|
+
if (!m) {
|
|
370
|
+
continue;
|
|
371
|
+
}
|
|
372
|
+
for (const [k, v] of m) {
|
|
373
|
+
if (k.startsWith("?")) {
|
|
374
|
+
notes.add(STYLE_ISSUE.NOT_CARRIED, target, k.slice(1), { sample: v });
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
fillToolDefaults(target, out, maps.length, options.defaults ?? null);
|
|
379
|
+
return out;
|
|
380
|
+
}
|
|
381
|
+
//# sourceMappingURL=resolve.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolve.js","sourceRoot":"","sources":["../../../../src/styles/cytoscape/resolve.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAW9E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EACH,WAAW,EACX,iBAAiB,EAEjB,aAAa,EACb,YAAY,EACZ,UAAU,GACb,MAAM,cAA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,MAAM,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QAC9B,CAAC;IACL,CAAC;IACD,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;QACnB,IAAI,CAAC,CAAC,EAAE,CAAC;YACL,SAAS;QACb,CAAC;QACD,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;YACrB,IAAI,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACpB,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,WAAW,EAAE,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC;YAC1E,CAAC;QACL,CAAC;IACL,CAAC;IACD,gBAAgB,CAAC,MAAM,EAAE,GAAG,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,QAAQ,IAAI,IAAI,CAAC,CAAC;IACrE,OAAO,GAAG,CAAC;AACf,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Cytoscape visual style as neutral rules: the defaults as one rule, then one rule per mapped column and kind.
|
|
3
|
+
* Cytoscape's precedence (a mapping over a default) becomes rule order. Bypasses are not rules: they are the
|
|
4
|
+
* per-element exceptions the planner lays on top of these.
|
|
5
|
+
*/
|
|
6
|
+
import { StyleNotes } from "../notes.js";
|
|
7
|
+
import type { ColumnRef, StyleColumn, StyleRule, StyleTarget, StyleWorkBudget } from "../types.js";
|
|
8
|
+
import type { CytoscapeStyle } from "./mappings.js";
|
|
9
|
+
import { type CytoscapeElements } from "./resolve.js";
|
|
10
|
+
/**
|
|
11
|
+
* Options of `cytoscapeRules()`.
|
|
12
|
+
* @category Styles
|
|
13
|
+
*/
|
|
14
|
+
export interface CytoscapeTranslateOptions {
|
|
15
|
+
/** Where problems are noted. */
|
|
16
|
+
readonly notes?: StyleNotes;
|
|
17
|
+
/** The counted work budget. */
|
|
18
|
+
readonly budget?: StyleWorkBudget;
|
|
19
|
+
/**
|
|
20
|
+
* The column a mapping over a file column reads; defaults to `{ data: column }`. A writer's own tagged columns
|
|
21
|
+
* map back to style columns here.
|
|
22
|
+
*/
|
|
23
|
+
readonly columnRef?: (column: string) => ColumnRef;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Neutral rules of a Cytoscape style, and the style columns they read.
|
|
27
|
+
* @category Styles
|
|
28
|
+
*/
|
|
29
|
+
export interface CytoscapeRules {
|
|
30
|
+
/** The rules, bottom to top. */
|
|
31
|
+
readonly rules: StyleRule[];
|
|
32
|
+
/**
|
|
33
|
+
* Style columns by key: a passthrough whose file values Cytoscape reads differently from their plain reading
|
|
34
|
+
* (a 0..255 transparency, `ROUND_RECTANGLE`) reads its values from `cytoscape.<property>` instead.
|
|
35
|
+
*/
|
|
36
|
+
readonly columns: Map<string, StyleColumn>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Translates one target's Cytoscape style into neutral rules: one `defaults` rule over every element, then one
|
|
40
|
+
* `mapping` rule per mapped column and mapping kind (`node.discrete.Type`), with `nodeSizeLocked` and
|
|
41
|
+
* `arrowColorMatchesEdge` applied. Discrete keys keep their attribute type.
|
|
42
|
+
* @param target - nodes or edges
|
|
43
|
+
* @param style - the style
|
|
44
|
+
* @param elements - the elements (their bypasses decide which visual property a property is read from)
|
|
45
|
+
* @param options - notes, the budget and how a file column is referenced
|
|
46
|
+
* @returns the rules and the style columns they read
|
|
47
|
+
* @category Styles
|
|
48
|
+
*/
|
|
49
|
+
export declare function cytoscapeRules(target: StyleTarget, style: CytoscapeStyle, elements: CytoscapeElements, options?: CytoscapeTranslateOptions): CytoscapeRules;
|
|
50
|
+
//# sourceMappingURL=translate.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../../../src/styles/cytoscape/translate.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,KAAK,EAAE,SAAS,EAAW,WAAW,EAAE,SAAS,EAAE,WAAW,EAAc,eAAe,EAAE,MAAM,aAAa,CAAC;AAExH,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,eAAe,CAAC;AACtE,OAAO,EAGH,KAAK,iBAAiB,EAKzB,MAAM,cAAc,CAAC;AAEtB;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,gCAAgC;IAChC,QAAQ,CAAC,KAAK,CAAC,EAAE,UAAU,CAAC;IAC5B,+BAA+B;IAC/B,QAAQ,CAAC,MAAM,CAAC,EAAE,eAAe,CAAC;IAClC;;;OAGG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,SAAS,CAAC;CACtD;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC3B,gCAAgC;IAChC,QAAQ,CAAC,KAAK,EAAE,SAAS,EAAE,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;CAC9C;AAQD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAC1B,MAAM,EAAE,WAAW,EACnB,KAAK,EAAE,cAAc,EACrB,QAAQ,EAAE,iBAAiB,EAC3B,OAAO,GAAE,yBAA8B,GACxC,cAAc,CAqDhB"}
|