@graphty/graph-io 0.3.43 → 0.3.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/approximations-3Q4TsdTh.js +40 -0
- package/dist/chunks/approximations-3Q4TsdTh.js.map +1 -0
- package/dist/chunks/block-JQiwViEt.js +2777 -0
- package/dist/chunks/block-JQiwViEt.js.map +1 -0
- package/dist/chunks/{choose-DvpbdRuz.js → choose-BemygfH8.js} +3 -2
- package/dist/chunks/{choose-DvpbdRuz.js.map → choose-BemygfH8.js.map} +1 -1
- package/dist/chunks/{constants-fT3E8JYY.js → constants-BFUR_CtU.js} +6 -2
- package/dist/chunks/constants-BFUR_CtU.js.map +1 -0
- package/dist/chunks/convert-BcQ8_jMo.js +59 -0
- package/dist/chunks/convert-BcQ8_jMo.js.map +1 -0
- package/dist/chunks/emit-DCwFLts5.js +3456 -0
- package/dist/chunks/emit-DCwFLts5.js.map +1 -0
- package/dist/chunks/{escape-B62ZGM_a.js → escape-B1rMftd9.js} +43 -20
- package/dist/chunks/escape-B1rMftd9.js.map +1 -0
- package/dist/chunks/{export-rKLeGQMo.js → export-D7IGzTG4.js} +196 -792
- package/dist/chunks/export-D7IGzTG4.js.map +1 -0
- package/dist/chunks/{exporter-BWwEuOPT.js → exporter-BtnqYuuj.js} +22 -12
- package/dist/chunks/exporter-BtnqYuuj.js.map +1 -0
- package/dist/chunks/{exporter-yLxKBvLE.js → exporter-ChPyhBOv.js} +4 -3
- package/dist/chunks/{exporter-yLxKBvLE.js.map → exporter-ChPyhBOv.js.map} +1 -1
- package/dist/chunks/{exporter-8hLNemFk.js → exporter-KEPxYUXD.js} +133 -74
- package/dist/chunks/exporter-KEPxYUXD.js.map +1 -0
- package/dist/chunks/{exporter-RVtXVetw.js → exporter-quPUCBiC.js} +1805 -287
- package/dist/chunks/exporter-quPUCBiC.js.map +1 -0
- package/dist/chunks/format-GDmO6m6Q.js +676 -0
- package/dist/chunks/format-GDmO6m6Q.js.map +1 -0
- package/dist/chunks/generic-BL06jrJf.js +1347 -0
- package/dist/chunks/generic-BL06jrJf.js.map +1 -0
- package/dist/chunks/{importer-WrGRZb0N.js → importer-B7r2owVf.js} +449 -102
- package/dist/chunks/importer-B7r2owVf.js.map +1 -0
- package/dist/chunks/{importer-Ht7LNg8L.js → importer-BFmOP96W.js} +116 -296
- package/dist/chunks/importer-BFmOP96W.js.map +1 -0
- package/dist/chunks/{importer-BbNb7eNg.js → importer-C2nzGhdV.js} +1390 -129
- package/dist/chunks/importer-C2nzGhdV.js.map +1 -0
- package/dist/chunks/{importer-Dz7tI8Sa.js → importer-CbX2_rNF.js} +617 -115
- package/dist/chunks/importer-CbX2_rNF.js.map +1 -0
- package/dist/chunks/{importer-D794XUTe.js → importer-CdzeN6X4.js} +31 -8
- package/dist/chunks/importer-CdzeN6X4.js.map +1 -0
- package/dist/chunks/{importer-xZ-3suY1.js → importer-ChKNC_GN.js} +791 -135
- package/dist/chunks/importer-ChKNC_GN.js.map +1 -0
- package/dist/chunks/{importer-C98dpSH4.js → importer-dwoYpSqb.js} +141 -82
- package/dist/chunks/importer-dwoYpSqb.js.map +1 -0
- package/dist/chunks/index-B9fdNpTA.js +4310 -0
- package/dist/chunks/index-B9fdNpTA.js.map +1 -0
- package/dist/chunks/{json-elements-DKSqpNW1.js → json-elements-C4FwgnH5.js} +123 -32
- package/dist/chunks/json-elements-C4FwgnH5.js.map +1 -0
- package/dist/chunks/lexicon-B-knUi-l.js +508 -0
- package/dist/chunks/lexicon-B-knUi-l.js.map +1 -0
- package/dist/chunks/{ontology-export-CtRXjg_i.js → ontology-export-BSpbY5FL.js} +3 -2
- package/dist/chunks/{ontology-export-CtRXjg_i.js.map → ontology-export-BSpbY5FL.js.map} +1 -1
- package/dist/chunks/{records-Cu4bxYOm.js → records-Nwz_rbNt.js} +2 -2
- package/dist/chunks/{records-Cu4bxYOm.js.map → records-Nwz_rbNt.js.map} +1 -1
- package/dist/chunks/styles-Brt9JMfs.js +690 -0
- package/dist/chunks/styles-Brt9JMfs.js.map +1 -0
- package/dist/chunks/styles-_N-C8S-U.js +2102 -0
- package/dist/chunks/styles-_N-C8S-U.js.map +1 -0
- package/dist/chunks/styles-yed-DAfcIkf7.js +842 -0
- package/dist/chunks/styles-yed-DAfcIkf7.js.map +1 -0
- package/dist/chunks/{text-DHOJXnED.js → text-CgzMqHQb.js} +2 -2
- package/dist/chunks/{text-DHOJXnED.js.map → text-CgzMqHQb.js.map} +1 -1
- package/dist/chunks/units-XMZFIFe1.js +19 -0
- package/dist/chunks/units-XMZFIFe1.js.map +1 -0
- package/dist/csv.js +5 -4
- package/dist/csv.js.map +1 -1
- package/dist/cx.js +1 -1
- package/dist/cx2.js +2 -2
- package/dist/cys.js +1 -1
- package/dist/dot.js +5 -2
- package/dist/dot.js.map +1 -1
- package/dist/gexf.js +292 -412
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +8 -3031
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +354 -240
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +4 -2
- package/dist/graphml.js.map +1 -1
- package/dist/json.js +1 -1
- package/dist/neo4j.js +4 -3
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +4 -2
- package/dist/positions.d.ts +1 -0
- package/dist/positions.js +427 -0
- package/dist/positions.js.map +1 -0
- package/dist/src/common/codes.d.ts +6 -0
- package/dist/src/common/codes.d.ts.map +1 -1
- package/dist/src/common/codes.js +6 -0
- package/dist/src/common/codes.js.map +1 -1
- package/dist/src/common/escape.d.ts.map +1 -1
- package/dist/src/common/escape.js +4 -2
- package/dist/src/common/escape.js.map +1 -1
- package/dist/src/common/export.d.ts +10 -0
- package/dist/src/common/export.d.ts.map +1 -1
- package/dist/src/common/export.js +123 -100
- package/dist/src/common/export.js.map +1 -1
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +8 -1
- package/dist/src/common/input.js.map +1 -1
- package/dist/src/common/json-elements.d.ts +12 -9
- package/dist/src/common/json-elements.d.ts.map +1 -1
- package/dist/src/common/json-elements.js +160 -37
- package/dist/src/common/json-elements.js.map +1 -1
- package/dist/src/common/notes.d.ts +42 -0
- package/dist/src/common/notes.d.ts.map +1 -0
- package/dist/src/common/notes.js +72 -0
- package/dist/src/common/notes.js.map +1 -0
- package/dist/src/common/report.d.ts +18 -0
- package/dist/src/common/report.d.ts.map +1 -1
- package/dist/src/common/report.js +36 -1
- package/dist/src/common/report.js.map +1 -1
- package/dist/src/common/units.d.ts +24 -0
- package/dist/src/common/units.d.ts.map +1 -0
- package/dist/src/common/units.js +26 -0
- package/dist/src/common/units.js.map +1 -0
- package/dist/src/common/xml.d.ts +18 -0
- package/dist/src/common/xml.d.ts.map +1 -1
- package/dist/src/common/xml.js +42 -5
- package/dist/src/common/xml.js.map +1 -1
- package/dist/src/formats/cx/exporter.d.ts +6 -0
- package/dist/src/formats/cx/exporter.d.ts.map +1 -1
- package/dist/src/formats/cx/exporter.js +71 -8
- package/dist/src/formats/cx/exporter.js.map +1 -1
- package/dist/src/formats/cx/importer.d.ts +5 -2
- package/dist/src/formats/cx/importer.d.ts.map +1 -1
- package/dist/src/formats/cx/importer.js +102 -72
- package/dist/src/formats/cx/importer.js.map +1 -1
- package/dist/src/formats/cx/styles.d.ts +102 -0
- package/dist/src/formats/cx/styles.d.ts.map +1 -0
- package/dist/src/formats/cx/styles.js +225 -0
- package/dist/src/formats/cx/styles.js.map +1 -0
- package/dist/src/formats/cx2/exporter.d.ts +5 -0
- package/dist/src/formats/cx2/exporter.d.ts.map +1 -1
- package/dist/src/formats/cx2/exporter.js +181 -71
- package/dist/src/formats/cx2/exporter.js.map +1 -1
- package/dist/src/formats/cx2/importer.d.ts +4 -1
- package/dist/src/formats/cx2/importer.d.ts.map +1 -1
- package/dist/src/formats/cx2/importer.js +19 -1
- package/dist/src/formats/cx2/importer.js.map +1 -1
- package/dist/src/formats/cx2/styles.d.ts +18 -0
- package/dist/src/formats/cx2/styles.d.ts.map +1 -0
- package/dist/src/formats/cx2/styles.js +24 -0
- package/dist/src/formats/cx2/styles.js.map +1 -0
- package/dist/src/formats/cys/constants.d.ts +2 -0
- package/dist/src/formats/cys/constants.d.ts.map +1 -1
- package/dist/src/formats/cys/constants.js +2 -0
- package/dist/src/formats/cys/constants.js.map +1 -1
- package/dist/src/formats/cys/exporter.d.ts +6 -2
- package/dist/src/formats/cys/exporter.d.ts.map +1 -1
- package/dist/src/formats/cys/exporter.js +215 -53
- package/dist/src/formats/cys/exporter.js.map +1 -1
- package/dist/src/formats/cys/importer.d.ts +2 -1
- package/dist/src/formats/cys/importer.d.ts.map +1 -1
- package/dist/src/formats/cys/importer.js +119 -6
- package/dist/src/formats/cys/importer.js.map +1 -1
- package/dist/src/formats/cys/session.d.ts +2 -0
- package/dist/src/formats/cys/session.d.ts.map +1 -1
- package/dist/src/formats/cys/session.js +5 -0
- package/dist/src/formats/cys/session.js.map +1 -1
- package/dist/src/formats/cys/styles.d.ts +38 -0
- package/dist/src/formats/cys/styles.d.ts.map +1 -0
- package/dist/src/formats/cys/styles.js +213 -0
- package/dist/src/formats/cys/styles.js.map +1 -0
- package/dist/src/formats/cys/tables.d.ts +8 -3
- package/dist/src/formats/cys/tables.d.ts.map +1 -1
- package/dist/src/formats/cys/tables.js +88 -34
- package/dist/src/formats/cys/tables.js.map +1 -1
- package/dist/src/formats/dot/exporter.d.ts +2 -0
- package/dist/src/formats/dot/exporter.d.ts.map +1 -1
- package/dist/src/formats/dot/exporter.js +195 -81
- package/dist/src/formats/dot/exporter.js.map +1 -1
- package/dist/src/formats/dot/importer.d.ts.map +1 -1
- package/dist/src/formats/dot/importer.js +100 -20
- package/dist/src/formats/dot/importer.js.map +1 -1
- package/dist/src/formats/dot/index.d.ts +1 -0
- package/dist/src/formats/dot/index.d.ts.map +1 -1
- package/dist/src/formats/dot/index.js +1 -0
- package/dist/src/formats/dot/index.js.map +1 -1
- package/dist/src/formats/dot/positions.d.ts +14 -0
- package/dist/src/formats/dot/positions.d.ts.map +1 -0
- package/dist/src/formats/dot/positions.js +70 -0
- package/dist/src/formats/dot/positions.js.map +1 -0
- package/dist/src/formats/dot/styles.d.ts +82 -0
- package/dist/src/formats/dot/styles.d.ts.map +1 -0
- package/dist/src/formats/dot/styles.js +1484 -0
- package/dist/src/formats/dot/styles.js.map +1 -0
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
- package/dist/src/formats/gexf/exporter.js +20 -5
- package/dist/src/formats/gexf/exporter.js.map +1 -1
- package/dist/src/formats/gexf/importer.d.ts +8 -1
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +251 -131
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gexf/index.d.ts +8 -0
- package/dist/src/formats/gexf/index.d.ts.map +1 -1
- package/dist/src/formats/gexf/index.js +10 -2
- package/dist/src/formats/gexf/index.js.map +1 -1
- package/dist/src/formats/gexf/schema.d.ts +5 -0
- package/dist/src/formats/gexf/schema.d.ts.map +1 -1
- package/dist/src/formats/gexf/schema.js +5 -0
- package/dist/src/formats/gexf/schema.js.map +1 -1
- package/dist/src/formats/gexf/styles.d.ts +74 -0
- package/dist/src/formats/gexf/styles.d.ts.map +1 -0
- package/dist/src/formats/gexf/styles.js +604 -0
- package/dist/src/formats/gexf/styles.js.map +1 -0
- package/dist/src/formats/gml/exporter.d.ts +1 -5
- package/dist/src/formats/gml/exporter.d.ts.map +1 -1
- package/dist/src/formats/gml/exporter.js +19 -8
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/gml/importer.d.ts.map +1 -1
- package/dist/src/formats/gml/importer.js +4 -0
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/index.d.ts +2 -1
- package/dist/src/formats/gml/index.d.ts.map +1 -1
- package/dist/src/formats/gml/index.js +2 -1
- package/dist/src/formats/gml/index.js.map +1 -1
- package/dist/src/formats/gml/positions.d.ts +14 -0
- package/dist/src/formats/gml/positions.d.ts.map +1 -0
- package/dist/src/formats/gml/positions.js +46 -0
- package/dist/src/formats/gml/positions.js.map +1 -0
- package/dist/src/formats/gml/styles.d.ts +59 -0
- package/dist/src/formats/gml/styles.d.ts.map +1 -0
- package/dist/src/formats/gml/styles.js +1056 -0
- package/dist/src/formats/gml/styles.js.map +1 -0
- package/dist/src/formats/gml/syntax.d.ts +11 -0
- package/dist/src/formats/gml/syntax.d.ts.map +1 -1
- package/dist/src/formats/gml/syntax.js +151 -62
- package/dist/src/formats/gml/syntax.js.map +1 -1
- package/dist/src/formats/graphml/constants.d.ts +4 -0
- package/dist/src/formats/graphml/constants.d.ts.map +1 -1
- package/dist/src/formats/graphml/constants.js +5 -1
- package/dist/src/formats/graphml/constants.js.map +1 -1
- package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
- package/dist/src/formats/graphml/exporter.js +133 -65
- package/dist/src/formats/graphml/exporter.js.map +1 -1
- package/dist/src/formats/graphml/importer.d.ts +4 -1
- package/dist/src/formats/graphml/importer.d.ts.map +1 -1
- package/dist/src/formats/graphml/importer.js +100 -44
- package/dist/src/formats/graphml/importer.js.map +1 -1
- package/dist/src/formats/graphml/index.d.ts +1 -0
- package/dist/src/formats/graphml/index.d.ts.map +1 -1
- package/dist/src/formats/graphml/index.js +1 -0
- package/dist/src/formats/graphml/index.js.map +1 -1
- package/dist/src/formats/graphml/styles-plain.d.ts +19 -0
- package/dist/src/formats/graphml/styles-plain.d.ts.map +1 -0
- package/dist/src/formats/graphml/styles-plain.js +187 -0
- package/dist/src/formats/graphml/styles-plain.js.map +1 -0
- package/dist/src/formats/graphml/styles-yed.d.ts +179 -0
- package/dist/src/formats/graphml/styles-yed.d.ts.map +1 -0
- package/dist/src/formats/graphml/styles-yed.js +1086 -0
- package/dist/src/formats/graphml/styles-yed.js.map +1 -0
- package/dist/src/formats/graphml/styles-yfiles3.d.ts +19 -0
- package/dist/src/formats/graphml/styles-yfiles3.d.ts.map +1 -0
- package/dist/src/formats/graphml/styles-yfiles3.js +508 -0
- package/dist/src/formats/graphml/styles-yfiles3.js.map +1 -0
- package/dist/src/formats/graphml/tree.d.ts.map +1 -1
- package/dist/src/formats/graphml/tree.js +34 -19
- package/dist/src/formats/graphml/tree.js.map +1 -1
- package/dist/src/formats/graphml/yfiles.d.ts +16 -2
- package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
- package/dist/src/formats/graphml/yfiles.js +83 -12
- package/dist/src/formats/graphml/yfiles.js.map +1 -1
- package/dist/src/formats/json/exporter.d.ts +5 -0
- package/dist/src/formats/json/exporter.d.ts.map +1 -1
- package/dist/src/formats/json/exporter.js +68 -25
- package/dist/src/formats/json/exporter.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts +22 -3
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +439 -264
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/positions.d.ts +16 -0
- package/dist/src/formats/json/positions.d.ts.map +1 -0
- package/dist/src/formats/json/positions.js +44 -0
- package/dist/src/formats/json/positions.js.map +1 -0
- package/dist/src/formats/json/styles.d.ts +102 -0
- package/dist/src/formats/json/styles.d.ts.map +1 -0
- package/dist/src/formats/json/styles.js +1753 -0
- package/dist/src/formats/json/styles.js.map +1 -0
- package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
- package/dist/src/formats/neo4j/exporter.js +2 -1
- package/dist/src/formats/neo4j/exporter.js.map +1 -1
- package/dist/src/formats/pajek/exporter.d.ts +2 -0
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +142 -76
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.d.ts +4 -0
- package/dist/src/formats/pajek/importer.d.ts.map +1 -1
- package/dist/src/formats/pajek/importer.js +60 -6
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/index.d.ts +2 -0
- package/dist/src/formats/pajek/index.d.ts.map +1 -1
- package/dist/src/formats/pajek/index.js +2 -0
- package/dist/src/formats/pajek/index.js.map +1 -1
- package/dist/src/formats/pajek/styles.d.ts +50 -0
- package/dist/src/formats/pajek/styles.d.ts.map +1 -0
- package/dist/src/formats/pajek/styles.js +569 -0
- package/dist/src/formats/pajek/styles.js.map +1 -0
- package/dist/src/formats/pajek/syntax.d.ts +6 -0
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +6 -0
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/columns.d.ts.map +1 -1
- package/dist/src/formats/xgmml/columns.js +34 -9
- package/dist/src/formats/xgmml/columns.js.map +1 -1
- package/dist/src/formats/xgmml/constants.d.ts +2 -0
- package/dist/src/formats/xgmml/constants.d.ts.map +1 -1
- package/dist/src/formats/xgmml/constants.js +3 -1
- package/dist/src/formats/xgmml/constants.js.map +1 -1
- package/dist/src/formats/xgmml/document.d.ts +12 -8
- package/dist/src/formats/xgmml/document.d.ts.map +1 -1
- package/dist/src/formats/xgmml/document.js +56 -13
- package/dist/src/formats/xgmml/document.js.map +1 -1
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
- package/dist/src/formats/xgmml/emit.js +12 -6
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/exporter.d.ts +3 -1
- package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
- package/dist/src/formats/xgmml/exporter.js +22 -9
- package/dist/src/formats/xgmml/exporter.js.map +1 -1
- package/dist/src/formats/xgmml/importer.d.ts +2 -1
- package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
- package/dist/src/formats/xgmml/importer.js +31 -24
- package/dist/src/formats/xgmml/importer.js.map +1 -1
- package/dist/src/formats/xgmml/styles.d.ts +104 -0
- package/dist/src/formats/xgmml/styles.d.ts.map +1 -0
- package/dist/src/formats/xgmml/styles.js +310 -0
- package/dist/src/formats/xgmml/styles.js.map +1 -0
- package/dist/src/index.d.ts +9 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -7
- package/dist/src/index.js.map +1 -1
- package/dist/src/positions/codes.d.ts +31 -0
- package/dist/src/positions/codes.d.ts.map +1 -0
- package/dist/src/positions/codes.js +26 -0
- package/dist/src/positions/codes.js.map +1 -0
- package/dist/src/positions/convert.d.ts +58 -0
- package/dist/src/positions/convert.d.ts.map +1 -0
- package/dist/src/positions/convert.js +107 -0
- package/dist/src/positions/convert.js.map +1 -0
- package/dist/src/positions/extract.d.ts +27 -0
- package/dist/src/positions/extract.d.ts.map +1 -0
- package/dist/src/positions/extract.js +526 -0
- package/dist/src/positions/extract.js.map +1 -0
- package/dist/src/positions/index.d.ts +10 -0
- package/dist/src/positions/index.d.ts.map +1 -0
- package/dist/src/positions/index.js +9 -0
- package/dist/src/positions/index.js.map +1 -0
- package/dist/src/positions/types.d.ts +208 -0
- package/dist/src/positions/types.d.ts.map +1 -0
- package/dist/src/positions/types.js +10 -0
- package/dist/src/positions/types.js.map +1 -0
- package/dist/src/registry.d.ts +30 -0
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +130 -9
- package/dist/src/registry.js.map +1 -1
- package/dist/src/styles/annotations.d.ts +132 -0
- package/dist/src/styles/annotations.d.ts.map +1 -0
- package/dist/src/styles/annotations.js +320 -0
- package/dist/src/styles/annotations.js.map +1 -0
- package/dist/src/styles/budget.d.ts +45 -0
- package/dist/src/styles/budget.d.ts.map +1 -0
- package/dist/src/styles/budget.js +58 -0
- package/dist/src/styles/budget.js.map +1 -0
- package/dist/src/styles/canon/bends.d.ts +32 -0
- package/dist/src/styles/canon/bends.d.ts.map +1 -0
- package/dist/src/styles/canon/bends.js +74 -0
- package/dist/src/styles/canon/bends.js.map +1 -0
- package/dist/src/styles/canon/color-tables.d.ts +22 -0
- package/dist/src/styles/canon/color-tables.d.ts.map +1 -0
- package/dist/src/styles/canon/color-tables.js +369 -0
- package/dist/src/styles/canon/color-tables.js.map +1 -0
- package/dist/src/styles/canon/color.d.ts +66 -0
- package/dist/src/styles/canon/color.d.ts.map +1 -0
- package/dist/src/styles/canon/color.js +548 -0
- package/dist/src/styles/canon/color.js.map +1 -0
- package/dist/src/styles/canon/enums.d.ts +25 -0
- package/dist/src/styles/canon/enums.d.ts.map +1 -0
- package/dist/src/styles/canon/enums.js +187 -0
- package/dist/src/styles/canon/enums.js.map +1 -0
- package/dist/src/styles/canon/graphviz.d.ts +48 -0
- package/dist/src/styles/canon/graphviz.d.ts.map +1 -0
- package/dist/src/styles/canon/graphviz.js +160 -0
- package/dist/src/styles/canon/graphviz.js.map +1 -0
- package/dist/src/styles/canon/index.d.ts +13 -0
- package/dist/src/styles/canon/index.d.ts.map +1 -0
- package/dist/src/styles/canon/index.js +13 -0
- package/dist/src/styles/canon/index.js.map +1 -0
- package/dist/src/styles/canon/number.d.ts +59 -0
- package/dist/src/styles/canon/number.d.ts.map +1 -0
- package/dist/src/styles/canon/number.js +142 -0
- package/dist/src/styles/canon/number.js.map +1 -0
- package/dist/src/styles/canon/site.d.ts +51 -0
- package/dist/src/styles/canon/site.d.ts.map +1 -0
- package/dist/src/styles/canon/site.js +63 -0
- package/dist/src/styles/canon/site.js.map +1 -0
- package/dist/src/styles/canon/text.d.ts +61 -0
- package/dist/src/styles/canon/text.d.ts.map +1 -0
- package/dist/src/styles/canon/text.js +199 -0
- package/dist/src/styles/canon/text.js.map +1 -0
- package/dist/src/styles/codes.d.ts +95 -0
- package/dist/src/styles/codes.d.ts.map +1 -0
- package/dist/src/styles/codes.js +97 -0
- package/dist/src/styles/codes.js.map +1 -0
- package/dist/src/styles/cyjs/cascade.d.ts +134 -0
- package/dist/src/styles/cyjs/cascade.d.ts.map +1 -0
- package/dist/src/styles/cyjs/cascade.js +2252 -0
- package/dist/src/styles/cyjs/cascade.js.map +1 -0
- package/dist/src/styles/cyjs/defaults-table.d.ts +25 -0
- package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -0
- package/dist/src/styles/cyjs/defaults-table.js +76 -0
- package/dist/src/styles/cyjs/defaults-table.js.map +1 -0
- package/dist/src/styles/cyjs/emit.d.ts +82 -0
- package/dist/src/styles/cyjs/emit.d.ts.map +1 -0
- package/dist/src/styles/cyjs/emit.js +790 -0
- package/dist/src/styles/cyjs/emit.js.map +1 -0
- package/dist/src/styles/cyjs/index.d.ts +13 -0
- package/dist/src/styles/cyjs/index.d.ts.map +1 -0
- package/dist/src/styles/cyjs/index.js +13 -0
- package/dist/src/styles/cyjs/index.js.map +1 -0
- package/dist/src/styles/cyjs/live.d.ts +46 -0
- package/dist/src/styles/cyjs/live.d.ts.map +1 -0
- package/dist/src/styles/cyjs/live.js +108 -0
- package/dist/src/styles/cyjs/live.js.map +1 -0
- package/dist/src/styles/cyjs/mappers.d.ts +147 -0
- package/dist/src/styles/cyjs/mappers.d.ts.map +1 -0
- package/dist/src/styles/cyjs/mappers.js +744 -0
- package/dist/src/styles/cyjs/mappers.js.map +1 -0
- package/dist/src/styles/cyjs/selector.d.ts +113 -0
- package/dist/src/styles/cyjs/selector.d.ts.map +1 -0
- package/dist/src/styles/cyjs/selector.js +611 -0
- package/dist/src/styles/cyjs/selector.js.map +1 -0
- package/dist/src/styles/cyjs/stylesheet-text.d.ts +37 -0
- package/dist/src/styles/cyjs/stylesheet-text.d.ts.map +1 -0
- package/dist/src/styles/cyjs/stylesheet-text.js +181 -0
- package/dist/src/styles/cyjs/stylesheet-text.js.map +1 -0
- package/dist/src/styles/cytoscape/emit.d.ts +125 -0
- package/dist/src/styles/cytoscape/emit.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/emit.js +1025 -0
- package/dist/src/styles/cytoscape/emit.js.map +1 -0
- package/dist/src/styles/cytoscape/index.d.ts +10 -0
- package/dist/src/styles/cytoscape/index.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/index.js +10 -0
- package/dist/src/styles/cytoscape/index.js.map +1 -0
- package/dist/src/styles/cytoscape/lexicon.d.ts +49 -0
- package/dist/src/styles/cytoscape/lexicon.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/lexicon.js +603 -0
- package/dist/src/styles/cytoscape/lexicon.js.map +1 -0
- package/dist/src/styles/cytoscape/mappings.d.ts +171 -0
- package/dist/src/styles/cytoscape/mappings.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/mappings.js +460 -0
- package/dist/src/styles/cytoscape/mappings.js.map +1 -0
- package/dist/src/styles/cytoscape/resolve.d.ts +137 -0
- package/dist/src/styles/cytoscape/resolve.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/resolve.js +381 -0
- package/dist/src/styles/cytoscape/resolve.js.map +1 -0
- package/dist/src/styles/cytoscape/translate.d.ts +50 -0
- package/dist/src/styles/cytoscape/translate.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/translate.js +156 -0
- package/dist/src/styles/cytoscape/translate.js.map +1 -0
- package/dist/src/styles/defaults.d.ts +90 -0
- package/dist/src/styles/defaults.d.ts.map +1 -0
- package/dist/src/styles/defaults.js +414 -0
- package/dist/src/styles/defaults.js.map +1 -0
- package/dist/src/styles/index.d.ts +15 -0
- package/dist/src/styles/index.d.ts.map +1 -0
- package/dist/src/styles/index.js +14 -0
- package/dist/src/styles/index.js.map +1 -0
- package/dist/src/styles/internal.d.ts +17 -0
- package/dist/src/styles/internal.d.ts.map +1 -0
- package/dist/src/styles/internal.js +16 -0
- package/dist/src/styles/internal.js.map +1 -0
- package/dist/src/styles/io/approximations.d.ts +24 -0
- package/dist/src/styles/io/approximations.d.ts.map +1 -0
- package/dist/src/styles/io/approximations.js +51 -0
- package/dist/src/styles/io/approximations.js.map +1 -0
- package/dist/src/styles/io/block.d.ts +166 -0
- package/dist/src/styles/io/block.d.ts.map +1 -0
- package/dist/src/styles/io/block.js +930 -0
- package/dist/src/styles/io/block.js.map +1 -0
- package/dist/src/styles/io/generic.d.ts +88 -0
- package/dist/src/styles/io/generic.d.ts.map +1 -0
- package/dist/src/styles/io/generic.js +516 -0
- package/dist/src/styles/io/generic.js.map +1 -0
- package/dist/src/styles/io/index.d.ts +8 -0
- package/dist/src/styles/io/index.d.ts.map +1 -0
- package/dist/src/styles/io/index.js +7 -0
- package/dist/src/styles/io/index.js.map +1 -0
- package/dist/src/styles/io/writer.d.ts +80 -0
- package/dist/src/styles/io/writer.d.ts.map +1 -0
- package/dist/src/styles/io/writer.js +596 -0
- package/dist/src/styles/io/writer.js.map +1 -0
- package/dist/src/styles/notes.d.ts +47 -0
- package/dist/src/styles/notes.d.ts.map +1 -0
- package/dist/src/styles/notes.js +140 -0
- package/dist/src/styles/notes.js.map +1 -0
- package/dist/src/styles/plan/classes.d.ts +31 -0
- package/dist/src/styles/plan/classes.d.ts.map +1 -0
- package/dist/src/styles/plan/classes.js +139 -0
- package/dist/src/styles/plan/classes.js.map +1 -0
- package/dist/src/styles/plan/continuous.d.ts +32 -0
- package/dist/src/styles/plan/continuous.d.ts.map +1 -0
- package/dist/src/styles/plan/continuous.js +165 -0
- package/dist/src/styles/plan/continuous.js.map +1 -0
- package/dist/src/styles/plan/discrete.d.ts +39 -0
- package/dist/src/styles/plan/discrete.d.ts.map +1 -0
- package/dist/src/styles/plan/discrete.js +127 -0
- package/dist/src/styles/plan/discrete.js.map +1 -0
- package/dist/src/styles/plan/families.d.ts +31 -0
- package/dist/src/styles/plan/families.d.ts.map +1 -0
- package/dist/src/styles/plan/families.js +95 -0
- package/dist/src/styles/plan/families.js.map +1 -0
- package/dist/src/styles/plan/features.d.ts +58 -0
- package/dist/src/styles/plan/features.d.ts.map +1 -0
- package/dist/src/styles/plan/features.js +185 -0
- package/dist/src/styles/plan/features.js.map +1 -0
- package/dist/src/styles/plan/index.d.ts +7 -0
- package/dist/src/styles/plan/index.d.ts.map +1 -0
- package/dist/src/styles/plan/index.js +7 -0
- package/dist/src/styles/plan/index.js.map +1 -0
- package/dist/src/styles/plan/plan.d.ts +71 -0
- package/dist/src/styles/plan/plan.d.ts.map +1 -0
- package/dist/src/styles/plan/plan.js +893 -0
- package/dist/src/styles/plan/plan.js.map +1 -0
- package/dist/src/styles/plan/resolve.d.ts +137 -0
- package/dist/src/styles/plan/resolve.d.ts.map +1 -0
- package/dist/src/styles/plan/resolve.js +587 -0
- package/dist/src/styles/plan/resolve.js.map +1 -0
- package/dist/src/styles/types.d.ts +702 -0
- package/dist/src/styles/types.d.ts.map +1 -0
- package/dist/src/styles/types.js +10 -0
- package/dist/src/styles/types.js.map +1 -0
- package/dist/src/styles/vocabulary.d.ts +41 -0
- package/dist/src/styles/vocabulary.d.ts.map +1 -0
- package/dist/src/styles/vocabulary.js +140 -0
- package/dist/src/styles/vocabulary.js.map +1 -0
- package/dist/src/types.d.ts +64 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/styles.d.ts +1 -0
- package/dist/styles.js +322 -0
- package/dist/styles.js.map +1 -0
- package/dist/xgmml.js +5 -4
- package/dist/xgmml.js.map +1 -1
- package/package.json +13 -2
- package/src/common/codes.ts +7 -0
- package/src/common/escape.ts +5 -2
- package/src/common/export.ts +179 -140
- package/src/common/input.ts +8 -4
- package/src/common/json-elements.ts +169 -38
- package/src/common/notes.ts +94 -0
- package/src/common/report.ts +41 -1
- package/src/common/units.ts +42 -0
- package/src/common/xml.ts +45 -5
- package/src/formats/cx/exporter.ts +95 -11
- package/src/formats/cx/importer.ts +126 -90
- package/src/formats/cx/styles.ts +304 -0
- package/src/formats/cx2/exporter.ts +234 -77
- package/src/formats/cx2/importer.ts +19 -1
- package/src/formats/cx2/styles.ts +29 -0
- package/src/formats/cys/constants.ts +3 -0
- package/src/formats/cys/exporter.ts +246 -60
- package/src/formats/cys/importer.ts +125 -9
- package/src/formats/cys/session.ts +6 -0
- package/src/formats/cys/styles.ts +254 -0
- package/src/formats/cys/tables.ts +117 -48
- package/src/formats/dot/exporter.ts +262 -126
- package/src/formats/dot/importer.ts +111 -20
- package/src/formats/dot/index.ts +1 -0
- package/src/formats/dot/positions.ts +77 -0
- package/src/formats/dot/styles.ts +1741 -0
- package/src/formats/gexf/exporter.ts +27 -11
- package/src/formats/gexf/importer.ts +308 -158
- package/src/formats/gexf/index.ts +10 -0
- package/src/formats/gexf/schema.ts +5 -0
- package/src/formats/gexf/styles.ts +719 -0
- package/src/formats/gml/exporter.ts +33 -14
- package/src/formats/gml/importer.ts +4 -0
- package/src/formats/gml/index.ts +2 -1
- package/src/formats/gml/positions.ts +52 -0
- package/src/formats/gml/styles.ts +1248 -0
- package/src/formats/gml/syntax.ts +173 -62
- package/src/formats/graphml/constants.ts +5 -0
- package/src/formats/graphml/exporter.ts +163 -71
- package/src/formats/graphml/importer.ts +119 -45
- package/src/formats/graphml/index.ts +1 -0
- package/src/formats/graphml/styles-plain.ts +236 -0
- package/src/formats/graphml/styles-yed.ts +1221 -0
- package/src/formats/graphml/styles-yfiles3.ts +573 -0
- package/src/formats/graphml/tree.ts +36 -20
- package/src/formats/graphml/yfiles.ts +89 -13
- package/src/formats/json/exporter.ts +76 -26
- package/src/formats/json/importer.ts +541 -322
- package/src/formats/json/positions.ts +50 -0
- package/src/formats/json/styles.ts +2082 -0
- package/src/formats/neo4j/exporter.ts +2 -1
- package/src/formats/pajek/exporter.ts +195 -106
- package/src/formats/pajek/importer.ts +78 -9
- package/src/formats/pajek/index.ts +2 -0
- package/src/formats/pajek/styles.ts +685 -0
- package/src/formats/pajek/syntax.ts +7 -0
- package/src/formats/xgmml/columns.ts +39 -9
- package/src/formats/xgmml/constants.ts +3 -0
- package/src/formats/xgmml/document.ts +54 -12
- package/src/formats/xgmml/emit.ts +11 -6
- package/src/formats/xgmml/exporter.ts +32 -13
- package/src/formats/xgmml/importer.ts +43 -29
- package/src/formats/xgmml/styles.ts +400 -0
- package/src/index.ts +16 -0
- package/src/positions/codes.ts +32 -0
- package/src/positions/convert.ts +123 -0
- package/src/positions/extract.ts +619 -0
- package/src/positions/index.ts +23 -0
- package/src/positions/types.ts +221 -0
- package/src/registry.ts +179 -8
- package/src/styles/annotations.ts +478 -0
- package/src/styles/budget.ts +60 -0
- package/src/styles/canon/bends.ts +84 -0
- package/src/styles/canon/color-tables.ts +386 -0
- package/src/styles/canon/color.ts +624 -0
- package/src/styles/canon/enums.ts +211 -0
- package/src/styles/canon/graphviz.ts +189 -0
- package/src/styles/canon/index.ts +13 -0
- package/src/styles/canon/number.ts +152 -0
- package/src/styles/canon/site.ts +87 -0
- package/src/styles/canon/text.ts +221 -0
- package/src/styles/codes.ts +104 -0
- package/src/styles/cyjs/cascade.ts +2670 -0
- package/src/styles/cyjs/defaults-table.ts +82 -0
- package/src/styles/cyjs/emit.ts +951 -0
- package/src/styles/cyjs/index.ts +37 -0
- package/src/styles/cyjs/live.ts +147 -0
- package/src/styles/cyjs/mappers.ts +879 -0
- package/src/styles/cyjs/selector.ts +778 -0
- package/src/styles/cyjs/stylesheet-text.ts +214 -0
- package/src/styles/cytoscape/emit.ts +1264 -0
- package/src/styles/cytoscape/index.ts +40 -0
- package/src/styles/cytoscape/lexicon.ts +656 -0
- package/src/styles/cytoscape/mappings.ts +603 -0
- package/src/styles/cytoscape/resolve.ts +521 -0
- package/src/styles/cytoscape/translate.ts +237 -0
- package/src/styles/defaults.ts +504 -0
- package/src/styles/index.ts +57 -0
- package/src/styles/internal.ts +17 -0
- package/src/styles/io/approximations.ts +47 -0
- package/src/styles/io/block.ts +1138 -0
- package/src/styles/io/generic.ts +687 -0
- package/src/styles/io/index.ts +18 -0
- package/src/styles/io/writer.ts +745 -0
- package/src/styles/notes.ts +165 -0
- package/src/styles/plan/classes.ts +166 -0
- package/src/styles/plan/continuous.ts +218 -0
- package/src/styles/plan/discrete.ts +165 -0
- package/src/styles/plan/families.ts +115 -0
- package/src/styles/plan/features.ts +234 -0
- package/src/styles/plan/index.ts +7 -0
- package/src/styles/plan/plan.ts +1129 -0
- package/src/styles/plan/resolve.ts +685 -0
- package/src/styles/types.ts +814 -0
- package/src/styles/vocabulary.ts +172 -0
- package/src/types.ts +76 -1
- package/dist/chunks/constants-fT3E8JYY.js.map +0 -1
- package/dist/chunks/escape-B62ZGM_a.js.map +0 -1
- package/dist/chunks/export-rKLeGQMo.js.map +0 -1
- package/dist/chunks/exporter-8hLNemFk.js.map +0 -1
- package/dist/chunks/exporter-BWwEuOPT.js.map +0 -1
- package/dist/chunks/exporter-RVtXVetw.js.map +0 -1
- package/dist/chunks/importer-BbNb7eNg.js.map +0 -1
- package/dist/chunks/importer-C98dpSH4.js.map +0 -1
- package/dist/chunks/importer-D794XUTe.js.map +0 -1
- package/dist/chunks/importer-Dz7tI8Sa.js.map +0 -1
- package/dist/chunks/importer-Ht7LNg8L.js.map +0 -1
- package/dist/chunks/importer-WrGRZb0N.js.map +0 -1
- package/dist/chunks/importer-xZ-3suY1.js.map +0 -1
- package/dist/chunks/json-elements-DKSqpNW1.js.map +0 -1
|
@@ -0,0 +1,842 @@
|
|
|
1
|
+
import { t as toNeutral, a as toFilePositions } from "./convert-BcQ8_jMo.js";
|
|
2
|
+
import { m as plainCell, n as noteAt, a as STYLE_ISSUE, b as canonNumber, f as canonEnum, c as canonColor, o as colorOpacity, M as MAX_STYLE_VALUE_LENGTH, h as canonText } from "./block-JQiwViEt.js";
|
|
3
|
+
import { S as StyleApproximations } from "./approximations-3Q4TsdTh.js";
|
|
4
|
+
const fraction = (v) => String(Math.round(v * 1e4) / 1e4);
|
|
5
|
+
function canonBends(source, target, points, yDown) {
|
|
6
|
+
const flip = -1;
|
|
7
|
+
const dx = target[0] - source[0];
|
|
8
|
+
const dy = (target[1] - source[1]) * flip;
|
|
9
|
+
const length2 = dx * dx + dy * dy;
|
|
10
|
+
if (points.length === 0 || length2 <= 0 || !Number.isFinite(length2)) {
|
|
11
|
+
return null;
|
|
12
|
+
}
|
|
13
|
+
const out = [];
|
|
14
|
+
for (const [px, py] of points) {
|
|
15
|
+
const rx = px - source[0];
|
|
16
|
+
const ry = (py - source[1]) * flip;
|
|
17
|
+
const along = (rx * dx + ry * dy) / length2;
|
|
18
|
+
const across = (dx * ry - dy * rx) / length2;
|
|
19
|
+
if (!Number.isFinite(along) || !Number.isFinite(across)) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
out.push(`${fraction(along)},${fraction(across)}`);
|
|
23
|
+
}
|
|
24
|
+
return out.join(" ");
|
|
25
|
+
}
|
|
26
|
+
function bendsToPoints(source, target, value, yDown) {
|
|
27
|
+
const flip = -1;
|
|
28
|
+
const dx = target[0] - source[0];
|
|
29
|
+
const dy = (target[1] - source[1]) * flip;
|
|
30
|
+
const out = [];
|
|
31
|
+
for (const pair of value.trim().split(/\s+/)) {
|
|
32
|
+
const [a, c, extra] = pair.split(",").map(Number);
|
|
33
|
+
if (extra !== void 0 || !Number.isFinite(a) || !Number.isFinite(c)) {
|
|
34
|
+
return null;
|
|
35
|
+
}
|
|
36
|
+
const x = source[0] + a * dx - c * dy;
|
|
37
|
+
const y = source[1] + (a * dy + c * dx) * flip;
|
|
38
|
+
if (!Number.isFinite(x) || !Number.isFinite(y)) {
|
|
39
|
+
return null;
|
|
40
|
+
}
|
|
41
|
+
out.push([x, y]);
|
|
42
|
+
}
|
|
43
|
+
return out.length === 0 ? null : out;
|
|
44
|
+
}
|
|
45
|
+
function isTree(value) {
|
|
46
|
+
return typeof value === "object" && value !== null && !Array.isArray(value);
|
|
47
|
+
}
|
|
48
|
+
function localOf(name) {
|
|
49
|
+
const colon = name.indexOf(":");
|
|
50
|
+
return colon < 0 ? name : name.slice(colon + 1);
|
|
51
|
+
}
|
|
52
|
+
function treeChildren(node, local) {
|
|
53
|
+
const out = [];
|
|
54
|
+
if (!isTree(node)) {
|
|
55
|
+
return out;
|
|
56
|
+
}
|
|
57
|
+
for (const key of Object.keys(node)) {
|
|
58
|
+
if (key.startsWith("@_") || key === "#text" || localOf(key) !== local) {
|
|
59
|
+
continue;
|
|
60
|
+
}
|
|
61
|
+
const value = node[key];
|
|
62
|
+
if (Array.isArray(value)) {
|
|
63
|
+
for (const item of value) {
|
|
64
|
+
out.push(item);
|
|
65
|
+
}
|
|
66
|
+
} else {
|
|
67
|
+
out.push(value);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return out;
|
|
71
|
+
}
|
|
72
|
+
function treeChild(node, local) {
|
|
73
|
+
if (!isTree(node)) {
|
|
74
|
+
return void 0;
|
|
75
|
+
}
|
|
76
|
+
for (const key of Object.keys(node)) {
|
|
77
|
+
if (!key.startsWith("@_") && key !== "#text" && localOf(key) === local) {
|
|
78
|
+
const value = node[key];
|
|
79
|
+
return Array.isArray(value) ? value[0] : value;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
return void 0;
|
|
83
|
+
}
|
|
84
|
+
function treeAttr(node, name) {
|
|
85
|
+
if (!isTree(node) || !Object.hasOwn(node, `@_${name}`)) {
|
|
86
|
+
return void 0;
|
|
87
|
+
}
|
|
88
|
+
const value = node[`@_${name}`];
|
|
89
|
+
return typeof value === "string" ? value : void 0;
|
|
90
|
+
}
|
|
91
|
+
function treeText(node) {
|
|
92
|
+
if (typeof node === "string") {
|
|
93
|
+
return node;
|
|
94
|
+
}
|
|
95
|
+
if (isTree(node) && Object.hasOwn(node, "#text")) {
|
|
96
|
+
const text = node["#text"];
|
|
97
|
+
return typeof text === "string" ? text : null;
|
|
98
|
+
}
|
|
99
|
+
return null;
|
|
100
|
+
}
|
|
101
|
+
function treeColumns(table) {
|
|
102
|
+
const out = [];
|
|
103
|
+
for (const col of table) {
|
|
104
|
+
if (col.dtype === "json" && col.meta.origin?.namespace === "yfiles") {
|
|
105
|
+
out.push(col.meta.name);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return out;
|
|
109
|
+
}
|
|
110
|
+
function yfilesColumns(table) {
|
|
111
|
+
const out = [];
|
|
112
|
+
for (const col of table) {
|
|
113
|
+
if (col.meta.origin?.namespace === "yfiles") {
|
|
114
|
+
out.push(col.meta.name);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
return out;
|
|
118
|
+
}
|
|
119
|
+
const NODE_REALIZERS = /* @__PURE__ */ new Set([
|
|
120
|
+
"ShapeNode",
|
|
121
|
+
"GenericNode",
|
|
122
|
+
"GroupNode",
|
|
123
|
+
"GenericGroupNode",
|
|
124
|
+
"SVGNode",
|
|
125
|
+
"ImageNode",
|
|
126
|
+
"TableNode",
|
|
127
|
+
"UMLClassNode",
|
|
128
|
+
"UMLNoteNode",
|
|
129
|
+
"ProxyAutoBoundsNode"
|
|
130
|
+
]);
|
|
131
|
+
const EDGE_REALIZERS = /* @__PURE__ */ new Set([
|
|
132
|
+
"PolyLineEdge",
|
|
133
|
+
"ArcEdge",
|
|
134
|
+
"BezierEdge",
|
|
135
|
+
"QuadCurveEdge",
|
|
136
|
+
"SplineEdge",
|
|
137
|
+
"GenericEdge"
|
|
138
|
+
]);
|
|
139
|
+
function realizerOf(tree, names) {
|
|
140
|
+
if (!isTree(tree)) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
for (const key of Object.keys(tree)) {
|
|
144
|
+
const type = localOf(key);
|
|
145
|
+
if (key.startsWith("@_") || !names.has(type)) {
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
const value = tree[key];
|
|
149
|
+
const r = Array.isArray(value) ? value[0] : value;
|
|
150
|
+
return type === "ProxyAutoBoundsNode" ? activeRealizer(r) : { type, r };
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
function activeRealizer(proxy) {
|
|
155
|
+
const realizers = treeChild(proxy, "Realizers");
|
|
156
|
+
const all = [];
|
|
157
|
+
if (isTree(realizers)) {
|
|
158
|
+
for (const k of Object.keys(realizers).filter((key) => !key.startsWith("@_") && key !== "#text")) {
|
|
159
|
+
for (const item of treeChildren(realizers, localOf(k))) {
|
|
160
|
+
all.push({ type: localOf(k), r: item });
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
const active = Number(treeAttr(realizers, "active") ?? "0");
|
|
165
|
+
return all[Number.isInteger(active) && active >= 0 && active < all.length ? active : 0] ?? null;
|
|
166
|
+
}
|
|
167
|
+
const FLOWCHART_SHAPES = /* @__PURE__ */ new Map([
|
|
168
|
+
["process", "rectangle"],
|
|
169
|
+
["decision", "diamond"],
|
|
170
|
+
["terminator", "round-rectangle"],
|
|
171
|
+
["start1", "ellipse"],
|
|
172
|
+
["start2", "ellipse"],
|
|
173
|
+
["data", "parallelogram"],
|
|
174
|
+
["preparation", "hexagon"]
|
|
175
|
+
]);
|
|
176
|
+
const FLOWCHART_PREFIX = "com.yworks.flowchart.";
|
|
177
|
+
function flowchartShape(configuration) {
|
|
178
|
+
return configuration.startsWith(FLOWCHART_PREFIX) ? FLOWCHART_SHAPES.get(configuration.slice(FLOWCHART_PREFIX.length)) ?? null : null;
|
|
179
|
+
}
|
|
180
|
+
const GENERIC_SHAPES = [
|
|
181
|
+
["ellipse", "ellipse"],
|
|
182
|
+
["circle", "ellipse"],
|
|
183
|
+
["oval", "ellipse"],
|
|
184
|
+
["diamond", "diamond"],
|
|
185
|
+
["decision", "diamond"],
|
|
186
|
+
["hexagon", "hexagon"],
|
|
187
|
+
["octagon", "octagon"],
|
|
188
|
+
["triangle", "triangle"],
|
|
189
|
+
["rect", "rectangle"],
|
|
190
|
+
["process", "rectangle"],
|
|
191
|
+
["box", "rectangle"]
|
|
192
|
+
];
|
|
193
|
+
const YED_POSITIONS = /* @__PURE__ */ new Map([
|
|
194
|
+
["c", "center"],
|
|
195
|
+
["t", "top"],
|
|
196
|
+
["b", "bottom"],
|
|
197
|
+
["l", "left"],
|
|
198
|
+
["r", "right"],
|
|
199
|
+
["tl", "top-left"],
|
|
200
|
+
["tr", "top-right"],
|
|
201
|
+
["bl", "bottom-left"],
|
|
202
|
+
["br", "bottom-right"],
|
|
203
|
+
["n", "top"],
|
|
204
|
+
["s", "bottom"],
|
|
205
|
+
["e", "right"],
|
|
206
|
+
["w", "left"],
|
|
207
|
+
["nw", "top-left"],
|
|
208
|
+
["ne", "top-right"],
|
|
209
|
+
["sw", "bottom-left"],
|
|
210
|
+
["se", "bottom-right"]
|
|
211
|
+
]);
|
|
212
|
+
const FONT_STYLES = /* @__PURE__ */ new Map([
|
|
213
|
+
["plain", ["normal", false]],
|
|
214
|
+
["bold", ["bold", false]],
|
|
215
|
+
["italic", ["normal", true]],
|
|
216
|
+
["bolditalic", ["bold", true]]
|
|
217
|
+
]);
|
|
218
|
+
function readColor(raw, property, opacity, put, at) {
|
|
219
|
+
const c = canonColor(raw, "yed", at(property));
|
|
220
|
+
if (c === null) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
put(property, c.color);
|
|
224
|
+
const alpha = colorOpacity(c, null, at(property), opacity !== null);
|
|
225
|
+
if (opacity !== null) {
|
|
226
|
+
put(opacity, alpha);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
function readLabels(labels, node, put, at) {
|
|
230
|
+
let label = void 0;
|
|
231
|
+
let text = "";
|
|
232
|
+
let extra = 0;
|
|
233
|
+
for (const l of labels) {
|
|
234
|
+
const t = treeText(l)?.trim() ?? "";
|
|
235
|
+
if (t.length === 0 || treeAttr(l, "visible") === "false" || treeAttr(l, "hasText") === "false") {
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
if (label === void 0) {
|
|
239
|
+
label = l;
|
|
240
|
+
text = t;
|
|
241
|
+
} else {
|
|
242
|
+
extra++;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
if (label === void 0) {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
if (extra > 0) {
|
|
249
|
+
noteAt(at("label"), STYLE_ISSUE.EXTRA_LABELS, `${String(extra + 1)} labels`);
|
|
250
|
+
}
|
|
251
|
+
put("label", canonText(text, at("label")));
|
|
252
|
+
readLabelLook(label, node, put, at);
|
|
253
|
+
}
|
|
254
|
+
function readLabelLook(label, node, put, at) {
|
|
255
|
+
readColor(treeAttr(label, "textColor"), "labelColor", null, put, at);
|
|
256
|
+
put("labelSize", canonNumber(treeAttr(label, "fontSize"), at("labelSize")));
|
|
257
|
+
put("labelFont", canonText(treeAttr(label, "fontFamily"), at("labelFont")));
|
|
258
|
+
const style = treeAttr(label, "fontStyle");
|
|
259
|
+
if (style !== void 0) {
|
|
260
|
+
const known = FONT_STYLES.get(style.trim().toLowerCase());
|
|
261
|
+
if (known === void 0) {
|
|
262
|
+
noteAt(at("labelWeight"), STYLE_ISSUE.UNKNOWN_VALUE, style.slice(0, MAX_STYLE_VALUE_LENGTH));
|
|
263
|
+
} else {
|
|
264
|
+
put("labelWeight", known[0]);
|
|
265
|
+
put("labelItalic", known[1]);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
const position = node ? treeAttr(label, "modelPosition") : void 0;
|
|
269
|
+
if (position !== void 0) {
|
|
270
|
+
const known = YED_POSITIONS.get(position.trim().toLowerCase());
|
|
271
|
+
if (known === void 0) {
|
|
272
|
+
noteAt(at("labelPosition"), STYLE_ISSUE.UNKNOWN_VALUE, position.slice(0, MAX_STYLE_VALUE_LENGTH));
|
|
273
|
+
}
|
|
274
|
+
put("labelPosition", known ?? null);
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
function realizerShape(real, at) {
|
|
278
|
+
const shape = treeChild(real.r, "Shape");
|
|
279
|
+
if (shape !== void 0) {
|
|
280
|
+
return canonEnum("shape", treeAttr(shape, "type"), "yed", at("shape"));
|
|
281
|
+
}
|
|
282
|
+
if (real.type === "ShapeNode" || real.type === "GroupNode" || real.type === "GenericGroupNode") {
|
|
283
|
+
return null;
|
|
284
|
+
}
|
|
285
|
+
if (real.type === "GenericNode") {
|
|
286
|
+
const conf = treeAttr(real.r, "configuration") ?? "";
|
|
287
|
+
const flowchart = flowchartShape(conf);
|
|
288
|
+
if (flowchart !== null) {
|
|
289
|
+
return flowchart;
|
|
290
|
+
}
|
|
291
|
+
const lower = conf.slice(0, MAX_STYLE_VALUE_LENGTH).toLowerCase();
|
|
292
|
+
for (const [word, value] of GENERIC_SHAPES) {
|
|
293
|
+
if (lower.includes(word)) {
|
|
294
|
+
return value;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
if (lower.length === 0) {
|
|
298
|
+
return null;
|
|
299
|
+
}
|
|
300
|
+
noteAt(at("shape"), STYLE_ISSUE.UNKNOWN_VALUE, lower);
|
|
301
|
+
return `other:${lower}`;
|
|
302
|
+
}
|
|
303
|
+
noteAt(at("shape"), STYLE_ISSUE.UNKNOWN_VALUE, real.type);
|
|
304
|
+
return `other:${real.type}`;
|
|
305
|
+
}
|
|
306
|
+
function readNode(real, put, at) {
|
|
307
|
+
const { r } = real;
|
|
308
|
+
const fill = treeChild(r, "Fill");
|
|
309
|
+
if (fill !== void 0) {
|
|
310
|
+
if (treeAttr(fill, "hasColor") === "false" || treeAttr(fill, "transparent") === "true") {
|
|
311
|
+
noteAt(at("fill"), STYLE_ISSUE.NO_FILL, "transparent");
|
|
312
|
+
put("fillOpacity", 0);
|
|
313
|
+
} else {
|
|
314
|
+
readColor(treeAttr(fill, "color"), "fill", "fillOpacity", put, at);
|
|
315
|
+
const second = treeAttr(fill, "color2");
|
|
316
|
+
if (second !== void 0) {
|
|
317
|
+
noteAt(at("fill"), STYLE_ISSUE.GRADIENT, second);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
const border = treeChild(r, "BorderStyle");
|
|
322
|
+
if (border !== void 0) {
|
|
323
|
+
if (treeAttr(border, "hasColor") === "false") {
|
|
324
|
+
put("borderWidth", 0);
|
|
325
|
+
} else {
|
|
326
|
+
readColor(treeAttr(border, "color"), "borderColor", null, put, at);
|
|
327
|
+
put("borderWidth", canonNumber(treeAttr(border, "width"), at("borderWidth")));
|
|
328
|
+
}
|
|
329
|
+
put("borderStyle", canonEnum("borderStyle", treeAttr(border, "type"), "yed", at("borderStyle")));
|
|
330
|
+
}
|
|
331
|
+
const geometry = treeChild(r, "Geometry");
|
|
332
|
+
put("width", canonNumber(treeAttr(geometry, "width"), at("width")));
|
|
333
|
+
put("height", canonNumber(treeAttr(geometry, "height"), at("height")));
|
|
334
|
+
put("shape", realizerShape(real, at));
|
|
335
|
+
readLabels(treeChildren(r, "NodeLabel"), true, put, at);
|
|
336
|
+
}
|
|
337
|
+
function readEdge(real, put, at) {
|
|
338
|
+
const { r } = real;
|
|
339
|
+
const line = treeChild(r, "LineStyle");
|
|
340
|
+
if (line !== void 0) {
|
|
341
|
+
readColor(treeAttr(line, "color"), "color", "opacity", put, at);
|
|
342
|
+
put("width", canonNumber(treeAttr(line, "width"), at("width")));
|
|
343
|
+
put("lineStyle", canonEnum("lineStyle", treeAttr(line, "type"), "yed", at("lineStyle")));
|
|
344
|
+
}
|
|
345
|
+
const arrows = treeChild(r, "Arrows");
|
|
346
|
+
if (arrows !== void 0) {
|
|
347
|
+
put("sourceArrow", canonEnum("arrow", treeAttr(arrows, "source"), "yed", at("sourceArrow")));
|
|
348
|
+
put("targetArrow", canonEnum("arrow", treeAttr(arrows, "target"), "yed", at("targetArrow")));
|
|
349
|
+
}
|
|
350
|
+
put("curved", edgeCurved(real));
|
|
351
|
+
readLabels(treeChildren(r, "EdgeLabel"), false, put, at);
|
|
352
|
+
}
|
|
353
|
+
function edgeCurved(real) {
|
|
354
|
+
if (real.type === "ArcEdge") {
|
|
355
|
+
return true;
|
|
356
|
+
}
|
|
357
|
+
const bent = treeChildren(treeChild(real.r, "Path"), "Point").length > 0;
|
|
358
|
+
if (real.type !== "PolyLineEdge") {
|
|
359
|
+
return bent;
|
|
360
|
+
}
|
|
361
|
+
const smoothed = treeAttr(treeChild(real.r, "BendStyle"), "smoothed");
|
|
362
|
+
return smoothed === void 0 ? null : smoothed === "true" && bent;
|
|
363
|
+
}
|
|
364
|
+
function edgeBends(real, centers, source, target) {
|
|
365
|
+
const points = treeChildren(treeChild(real.r, "Path"), "Point").map((p) => [
|
|
366
|
+
Number(treeAttr(p, "x")),
|
|
367
|
+
Number(treeAttr(p, "y"))
|
|
368
|
+
]);
|
|
369
|
+
const at = (k) => [centers[2 * k], centers[2 * k + 1]];
|
|
370
|
+
return canonBends(at(source), at(target), points);
|
|
371
|
+
}
|
|
372
|
+
function valueColumns(n) {
|
|
373
|
+
const values = /* @__PURE__ */ Object.create(null);
|
|
374
|
+
return {
|
|
375
|
+
values,
|
|
376
|
+
put(i, property, value) {
|
|
377
|
+
if (value !== null) {
|
|
378
|
+
values[property] ??= new Array(n).fill(null);
|
|
379
|
+
values[property][i] = value;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
}
|
|
384
|
+
function readYedStyles(snapshot, notes, budget) {
|
|
385
|
+
let found = false;
|
|
386
|
+
const centers = new Float64Array(2 * snapshot.nodeCount).fill(Number.NaN);
|
|
387
|
+
const read = (target) => {
|
|
388
|
+
const table = target === "node" ? snapshot.nodes : snapshot.edges;
|
|
389
|
+
const n = target === "node" ? snapshot.nodeCount : snapshot.edgeCount;
|
|
390
|
+
const names = target === "node" ? NODE_REALIZERS : EDGE_REALIZERS;
|
|
391
|
+
const columns = treeColumns(table);
|
|
392
|
+
const out = valueColumns(n);
|
|
393
|
+
if (columns.length === 0) {
|
|
394
|
+
return out.values;
|
|
395
|
+
}
|
|
396
|
+
for (let i = 0; i < n; i++) {
|
|
397
|
+
budget.spend(target, columns.length);
|
|
398
|
+
let real = null;
|
|
399
|
+
for (let c = 0; c < columns.length && real === null; c++) {
|
|
400
|
+
real = realizerOf(plainCell(table.value(columns[c], i)), names);
|
|
401
|
+
}
|
|
402
|
+
if (real === null) {
|
|
403
|
+
continue;
|
|
404
|
+
}
|
|
405
|
+
found = true;
|
|
406
|
+
const at = (property) => ({ notes, target, property, element: i, budget });
|
|
407
|
+
const put = (property, value) => {
|
|
408
|
+
out.put(i, property, value);
|
|
409
|
+
};
|
|
410
|
+
if (target === "node") {
|
|
411
|
+
readNode(real, put, at);
|
|
412
|
+
const geometry = treeChild(real.r, "Geometry");
|
|
413
|
+
centers[2 * i] = Number(treeAttr(geometry, "x")) + Number(treeAttr(geometry, "width")) / 2;
|
|
414
|
+
centers[2 * i + 1] = Number(treeAttr(geometry, "y")) + Number(treeAttr(geometry, "height")) / 2;
|
|
415
|
+
} else {
|
|
416
|
+
readEdge(real, put, at);
|
|
417
|
+
put("bends", edgeBends(real, centers, snapshot.edgeSource(i), snapshot.edgeTarget(i)));
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
return out.values;
|
|
421
|
+
};
|
|
422
|
+
const node = read("node");
|
|
423
|
+
const edge = read("edge");
|
|
424
|
+
return found ? { node, edge } : null;
|
|
425
|
+
}
|
|
426
|
+
const GRAPHML_STYLE_CAPABILITIES = Object.freeze({
|
|
427
|
+
node: Object.freeze([
|
|
428
|
+
"fill",
|
|
429
|
+
"fillOpacity",
|
|
430
|
+
"borderColor",
|
|
431
|
+
"borderWidth",
|
|
432
|
+
"borderStyle",
|
|
433
|
+
"shape",
|
|
434
|
+
"width",
|
|
435
|
+
"height",
|
|
436
|
+
"label",
|
|
437
|
+
"labelColor",
|
|
438
|
+
"labelSize",
|
|
439
|
+
"labelFont",
|
|
440
|
+
"labelWeight",
|
|
441
|
+
"labelItalic",
|
|
442
|
+
"labelPosition"
|
|
443
|
+
]),
|
|
444
|
+
edge: Object.freeze([
|
|
445
|
+
"color",
|
|
446
|
+
"opacity",
|
|
447
|
+
"width",
|
|
448
|
+
"lineStyle",
|
|
449
|
+
"sourceArrow",
|
|
450
|
+
"targetArrow",
|
|
451
|
+
"curved",
|
|
452
|
+
"bends",
|
|
453
|
+
"label",
|
|
454
|
+
"labelColor",
|
|
455
|
+
"labelSize",
|
|
456
|
+
"labelFont",
|
|
457
|
+
"labelWeight",
|
|
458
|
+
"labelItalic"
|
|
459
|
+
]),
|
|
460
|
+
block: "attributes"
|
|
461
|
+
});
|
|
462
|
+
const YED_SHAPES = /* @__PURE__ */ new Map([
|
|
463
|
+
["ellipse", "ellipse"],
|
|
464
|
+
["rectangle", "rectangle"],
|
|
465
|
+
["round-rectangle", "roundrectangle"],
|
|
466
|
+
["triangle", "triangle"],
|
|
467
|
+
["diamond", "diamond"],
|
|
468
|
+
["hexagon", "hexagon"],
|
|
469
|
+
["octagon", "octagon"],
|
|
470
|
+
["parallelogram", "parallelogram"],
|
|
471
|
+
["trapezoid", "trapezoid"],
|
|
472
|
+
["star", "star5"]
|
|
473
|
+
]);
|
|
474
|
+
const YED_LINES = /* @__PURE__ */ new Map([
|
|
475
|
+
["solid", "line"],
|
|
476
|
+
["dashed", "dashed"],
|
|
477
|
+
["dotted", "dotted"],
|
|
478
|
+
["dash-dot", "dashed_dotted"]
|
|
479
|
+
]);
|
|
480
|
+
const YED_ARROWS = /* @__PURE__ */ new Map([
|
|
481
|
+
["none", "none"],
|
|
482
|
+
["triangle", "standard"],
|
|
483
|
+
["triangle-open", "white_delta"],
|
|
484
|
+
["vee", "concave"],
|
|
485
|
+
["tee", "t_shape"],
|
|
486
|
+
["diamond", "diamond"],
|
|
487
|
+
["diamond-open", "white_diamond"],
|
|
488
|
+
["circle", "circle"],
|
|
489
|
+
["circle-open", "white_circle"],
|
|
490
|
+
["square", "skewed_dash"],
|
|
491
|
+
["crow", "crows_foot_many"]
|
|
492
|
+
]);
|
|
493
|
+
const YED_MODEL_POSITIONS = /* @__PURE__ */ new Map([
|
|
494
|
+
["center", "c"],
|
|
495
|
+
["top", "t"],
|
|
496
|
+
["bottom", "b"],
|
|
497
|
+
["left", "l"],
|
|
498
|
+
["right", "r"],
|
|
499
|
+
["top-left", "tl"],
|
|
500
|
+
["top-right", "tr"],
|
|
501
|
+
["bottom-left", "bl"],
|
|
502
|
+
["bottom-right", "br"]
|
|
503
|
+
]);
|
|
504
|
+
function yedValue(table, value, nearest) {
|
|
505
|
+
const exact = table.get(value);
|
|
506
|
+
if (exact !== void 0) {
|
|
507
|
+
return { value: exact, exact: true };
|
|
508
|
+
}
|
|
509
|
+
return value.startsWith("other:") ? { value: value.slice(6), exact: true } : { value: nearest, exact: false };
|
|
510
|
+
}
|
|
511
|
+
function yedColor(color, opacity) {
|
|
512
|
+
const hex = color.toUpperCase();
|
|
513
|
+
if (typeof opacity !== "number" || opacity >= 1) {
|
|
514
|
+
return hex;
|
|
515
|
+
}
|
|
516
|
+
return hex + Math.round(Math.max(0, opacity) * 255).toString(16).toUpperCase().padStart(2, "0");
|
|
517
|
+
}
|
|
518
|
+
function yedSpelled(table, value, nearest, property, approximate) {
|
|
519
|
+
const w = yedValue(table, value, nearest);
|
|
520
|
+
if (!w.exact) {
|
|
521
|
+
approximate(property, value);
|
|
522
|
+
}
|
|
523
|
+
return w.value;
|
|
524
|
+
}
|
|
525
|
+
function labelTree(get, node, approximate) {
|
|
526
|
+
const text = get("label");
|
|
527
|
+
if (typeof text !== "string" || text.trim().length === 0) {
|
|
528
|
+
return null;
|
|
529
|
+
}
|
|
530
|
+
const label = {};
|
|
531
|
+
const font = get("labelFont");
|
|
532
|
+
if (typeof font === "string") {
|
|
533
|
+
label["@_fontFamily"] = font;
|
|
534
|
+
}
|
|
535
|
+
const size = get("labelSize");
|
|
536
|
+
if (typeof size === "number") {
|
|
537
|
+
label["@_fontSize"] = String(size);
|
|
538
|
+
}
|
|
539
|
+
const weight = get("labelWeight");
|
|
540
|
+
const italic = get("labelItalic");
|
|
541
|
+
if (weight !== null || italic !== null) {
|
|
542
|
+
const style = (weight === "bold" ? "bold" : "") + (italic === true ? "italic" : "");
|
|
543
|
+
label["@_fontStyle"] = style.length === 0 ? "plain" : style;
|
|
544
|
+
}
|
|
545
|
+
const color = get("labelColor");
|
|
546
|
+
if (typeof color === "string") {
|
|
547
|
+
label["@_textColor"] = color.toUpperCase();
|
|
548
|
+
}
|
|
549
|
+
const position = node ? get("labelPosition") : null;
|
|
550
|
+
if (typeof position === "string") {
|
|
551
|
+
const written = YED_MODEL_POSITIONS.get(position);
|
|
552
|
+
if (written === void 0) {
|
|
553
|
+
approximate("labelPosition", position);
|
|
554
|
+
}
|
|
555
|
+
label["@_modelName"] = "internal";
|
|
556
|
+
label["@_modelPosition"] = written ?? "c";
|
|
557
|
+
}
|
|
558
|
+
label["#text"] = text;
|
|
559
|
+
return label;
|
|
560
|
+
}
|
|
561
|
+
function shapeNodeTree(get, at, approximate) {
|
|
562
|
+
const node = {};
|
|
563
|
+
node["y:Geometry"] = geometryTree(get, at);
|
|
564
|
+
const fill = get("fill");
|
|
565
|
+
const fillOpacity = get("fillOpacity");
|
|
566
|
+
if (typeof fill === "string") {
|
|
567
|
+
node["y:Fill"] = { "@_color": yedColor(fill, fillOpacity), "@_transparent": "false" };
|
|
568
|
+
} else if (fillOpacity === 0) {
|
|
569
|
+
node["y:Fill"] = { "@_hasColor": "false", "@_transparent": "false" };
|
|
570
|
+
}
|
|
571
|
+
const border = lineTree(get, ["borderColor", "borderWidth", "borderStyle"], approximate);
|
|
572
|
+
if (border !== null) {
|
|
573
|
+
node["y:BorderStyle"] = border;
|
|
574
|
+
}
|
|
575
|
+
const label = labelTree(get, true, approximate);
|
|
576
|
+
if (label !== null) {
|
|
577
|
+
node["y:NodeLabel"] = label;
|
|
578
|
+
}
|
|
579
|
+
const shape = get("shape");
|
|
580
|
+
if (typeof shape === "string") {
|
|
581
|
+
node["y:Shape"] = {
|
|
582
|
+
"@_type": yedSpelled(YED_SHAPES, shape, shape === "vee" ? "triangle" : "rectangle", "shape", approximate)
|
|
583
|
+
};
|
|
584
|
+
}
|
|
585
|
+
return { "y:ShapeNode": node };
|
|
586
|
+
}
|
|
587
|
+
function geometryTree(get, at) {
|
|
588
|
+
const geometry = {};
|
|
589
|
+
const height = get("height");
|
|
590
|
+
const width = get("width");
|
|
591
|
+
if (typeof height === "number") {
|
|
592
|
+
geometry["@_height"] = String(height);
|
|
593
|
+
}
|
|
594
|
+
if (typeof width === "number") {
|
|
595
|
+
geometry["@_width"] = String(width);
|
|
596
|
+
}
|
|
597
|
+
if (at !== null) {
|
|
598
|
+
geometry["@_x"] = at[0];
|
|
599
|
+
geometry["@_y"] = at[1];
|
|
600
|
+
}
|
|
601
|
+
return geometry;
|
|
602
|
+
}
|
|
603
|
+
function lineTree(get, properties, approximate, opacity) {
|
|
604
|
+
const [colorKey, widthKey, styleKey] = properties;
|
|
605
|
+
const color = get(colorKey);
|
|
606
|
+
const width = get(widthKey);
|
|
607
|
+
const style = get(styleKey);
|
|
608
|
+
if (color === null && width === null && style === null) {
|
|
609
|
+
return null;
|
|
610
|
+
}
|
|
611
|
+
const line = {};
|
|
612
|
+
if (typeof color === "string") {
|
|
613
|
+
line["@_color"] = opacity === void 0 ? color.toUpperCase() : yedColor(color, opacity);
|
|
614
|
+
}
|
|
615
|
+
if (typeof style === "string") {
|
|
616
|
+
const nearest = styleKey === "lineStyle" && style === "long-dash" ? "dashed" : "line";
|
|
617
|
+
line["@_type"] = yedSpelled(YED_LINES, style, nearest, styleKey, approximate);
|
|
618
|
+
}
|
|
619
|
+
if (typeof width === "number") {
|
|
620
|
+
line["@_width"] = String(width);
|
|
621
|
+
}
|
|
622
|
+
return line;
|
|
623
|
+
}
|
|
624
|
+
function polyLineEdgeTree(get, path, approximate) {
|
|
625
|
+
const edge = {};
|
|
626
|
+
if (path !== void 0) {
|
|
627
|
+
edge["y:Path"] = path;
|
|
628
|
+
}
|
|
629
|
+
const line = lineTree(get, ["color", "width", "lineStyle"], approximate, get("opacity"));
|
|
630
|
+
if (line !== null) {
|
|
631
|
+
edge["y:LineStyle"] = line;
|
|
632
|
+
}
|
|
633
|
+
const source = get("sourceArrow");
|
|
634
|
+
const target = get("targetArrow");
|
|
635
|
+
if (source !== null || target !== null) {
|
|
636
|
+
const arrow = (property, value) => typeof value === "string" ? yedSpelled(YED_ARROWS, value, "standard", property, approximate) : "none";
|
|
637
|
+
edge["y:Arrows"] = { "@_source": arrow("sourceArrow", source), "@_target": arrow("targetArrow", target) };
|
|
638
|
+
}
|
|
639
|
+
const label = labelTree(get, false, approximate);
|
|
640
|
+
if (label !== null) {
|
|
641
|
+
edge["y:EdgeLabel"] = label;
|
|
642
|
+
}
|
|
643
|
+
const curved = get("curved");
|
|
644
|
+
if (typeof curved === "boolean") {
|
|
645
|
+
edge["y:BendStyle"] = { "@_smoothed": String(curved) };
|
|
646
|
+
}
|
|
647
|
+
return { "y:PolyLineEdge": edge };
|
|
648
|
+
}
|
|
649
|
+
function getter(picture, target) {
|
|
650
|
+
const columns = /* @__PURE__ */ new Map();
|
|
651
|
+
for (const p of GRAPHML_STYLE_CAPABILITIES[target]) {
|
|
652
|
+
columns.set(p, picture(target, p));
|
|
653
|
+
}
|
|
654
|
+
return (i) => (property) => columns.get(property)?.[i] ?? null;
|
|
655
|
+
}
|
|
656
|
+
function exactFromBlock(read, picture, counts, notes) {
|
|
657
|
+
for (const target of ["node", "edge"]) {
|
|
658
|
+
const values = read[target];
|
|
659
|
+
const get = getter(picture, target);
|
|
660
|
+
for (let i = 0; i < counts[target]; i++) {
|
|
661
|
+
const want = get(i);
|
|
662
|
+
const back = writtenAndReadBack(target, want, notes);
|
|
663
|
+
if (back === null) {
|
|
664
|
+
continue;
|
|
665
|
+
}
|
|
666
|
+
for (const property of GRAPHML_STYLE_CAPABILITIES[target]) {
|
|
667
|
+
const native = values[property]?.[i] ?? null;
|
|
668
|
+
const w = want(property);
|
|
669
|
+
if (native !== w && native === (back.get(property) ?? null)) {
|
|
670
|
+
values[property] ??= new Array(counts[target]).fill(null);
|
|
671
|
+
values[property][i] = w;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
}
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
function writtenAndReadBack(target, want, notes) {
|
|
678
|
+
const ignore = () => void 0;
|
|
679
|
+
const tree = target === "node" ? shapeNodeTree(want, null, ignore) : polyLineEdgeTree(want, void 0, ignore);
|
|
680
|
+
const real = realizerOf(tree, target === "node" ? NODE_REALIZERS : EDGE_REALIZERS);
|
|
681
|
+
if (real === null) {
|
|
682
|
+
return null;
|
|
683
|
+
}
|
|
684
|
+
const back = /* @__PURE__ */ new Map();
|
|
685
|
+
const at = (property) => ({ notes, target, property });
|
|
686
|
+
const put = (property, value) => {
|
|
687
|
+
if (value !== null) {
|
|
688
|
+
back.set(property, value);
|
|
689
|
+
}
|
|
690
|
+
};
|
|
691
|
+
if (target === "node") {
|
|
692
|
+
readNode(real, put, at);
|
|
693
|
+
} else {
|
|
694
|
+
readEdge(real, put, at);
|
|
695
|
+
}
|
|
696
|
+
return back;
|
|
697
|
+
}
|
|
698
|
+
const GRAPHICS_TYPES = { node: "nodegraphics", edge: "edgegraphics" };
|
|
699
|
+
function keptPosition(table, columns, i) {
|
|
700
|
+
for (const name of columns) {
|
|
701
|
+
const tree = plainCell(table.value(name, i));
|
|
702
|
+
const real = realizerOf(tree, NODE_REALIZERS);
|
|
703
|
+
const geometry = real === null ? treeChild(tree, "RectD") : treeChild(real.r, "Geometry");
|
|
704
|
+
const x = treeAttr(geometry, real === null ? "X" : "x");
|
|
705
|
+
const y = treeAttr(geometry, real === null ? "Y" : "y");
|
|
706
|
+
if (x !== void 0 && y !== void 0) {
|
|
707
|
+
return [x, y];
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
return null;
|
|
711
|
+
}
|
|
712
|
+
function columnPosition(snapshot, i, get) {
|
|
713
|
+
const column = snapshot.nodes.byRole("position");
|
|
714
|
+
if (column === null || column.meta.components < 2 || !column.isSet(i)) {
|
|
715
|
+
return null;
|
|
716
|
+
}
|
|
717
|
+
const v = column.value(i);
|
|
718
|
+
const width = get("width");
|
|
719
|
+
const height = get("height");
|
|
720
|
+
const size = [typeof width === "number" ? width : 0, typeof height === "number" ? height : 0];
|
|
721
|
+
const p = [v[0], v[1], 0];
|
|
722
|
+
toNeutral(p, column.meta.extra ?? {}, size, false);
|
|
723
|
+
const [x, y] = toFilePositions(Float64Array.from(p), YED_SPELLING, {
|
|
724
|
+
width: Float64Array.of(size[0]),
|
|
725
|
+
height: Float64Array.of(size[1])
|
|
726
|
+
});
|
|
727
|
+
return Number.isFinite(x) && Number.isFinite(y) ? [String(x), String(y)] : null;
|
|
728
|
+
}
|
|
729
|
+
const YED_SPELLING = { yAxis: "down", anchor: "top-left" };
|
|
730
|
+
function keptPath(table, columns, e) {
|
|
731
|
+
for (const name of columns) {
|
|
732
|
+
const real = realizerOf(plainCell(table.value(name, e)), EDGE_REALIZERS);
|
|
733
|
+
const path = real === null ? void 0 : treeChild(real.r, "Path");
|
|
734
|
+
if (path !== void 0) {
|
|
735
|
+
return path;
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
return void 0;
|
|
739
|
+
}
|
|
740
|
+
function pathWithBends(kept, bends, ends) {
|
|
741
|
+
const points = typeof bends === "string" ? bendsToPoints(ends[0], ends[1], bends) : null;
|
|
742
|
+
if (points === null) {
|
|
743
|
+
return kept;
|
|
744
|
+
}
|
|
745
|
+
const path = {};
|
|
746
|
+
for (const port of ["sx", "sy", "tx", "ty"]) {
|
|
747
|
+
path[`@_${port}`] = treeAttr(kept, port) ?? "0.0";
|
|
748
|
+
}
|
|
749
|
+
path["y:Point"] = points.map(([x, y]) => ({ "@_x": String(x), "@_y": String(y) }));
|
|
750
|
+
return path;
|
|
751
|
+
}
|
|
752
|
+
function freeName(table, base) {
|
|
753
|
+
let name = base;
|
|
754
|
+
let k = 2;
|
|
755
|
+
while (table.has(name)) {
|
|
756
|
+
name = `${base}#${String(k)}`;
|
|
757
|
+
k++;
|
|
758
|
+
}
|
|
759
|
+
return name;
|
|
760
|
+
}
|
|
761
|
+
function graphmlStyledExport(snapshot, input) {
|
|
762
|
+
if (input === void 0) {
|
|
763
|
+
return null;
|
|
764
|
+
}
|
|
765
|
+
const approximated = new StyleApproximations();
|
|
766
|
+
const approximateFor = (target) => (property, value) => {
|
|
767
|
+
approximated.add(target, property, value);
|
|
768
|
+
};
|
|
769
|
+
const picture = (target, property) => input.picture(target, property);
|
|
770
|
+
const nodeColumns = treeColumns(snapshot.nodes);
|
|
771
|
+
const edgeColumns = treeColumns(snapshot.edges);
|
|
772
|
+
const getNode = getter(picture, "node");
|
|
773
|
+
const getEdge = getter(picture, "edge");
|
|
774
|
+
const nodeTrees = [];
|
|
775
|
+
for (let i = 0; i < snapshot.nodeCount; i++) {
|
|
776
|
+
const get = getNode(i);
|
|
777
|
+
const at = keptPosition(snapshot.nodes, nodeColumns, i) ?? columnPosition(snapshot, i, get);
|
|
778
|
+
nodeTrees.push(shapeNodeTree(get, at, approximateFor("node")));
|
|
779
|
+
}
|
|
780
|
+
const centers = nodeTrees.map((tree) => {
|
|
781
|
+
const geometry = treeChild(treeChild(tree, "ShapeNode"), "Geometry");
|
|
782
|
+
const at = (k) => Number(treeAttr(geometry, k) ?? Number.NaN);
|
|
783
|
+
return [at("x") + at("width") / 2, at("y") + at("height") / 2];
|
|
784
|
+
});
|
|
785
|
+
const edgeTrees = [];
|
|
786
|
+
for (let e = 0; e < snapshot.edgeCount; e++) {
|
|
787
|
+
const get = getEdge(e);
|
|
788
|
+
const ends = [
|
|
789
|
+
centers[snapshot.edgeSource(e)],
|
|
790
|
+
centers[snapshot.edgeTarget(e)]
|
|
791
|
+
];
|
|
792
|
+
const path = pathWithBends(keptPath(snapshot.edges, edgeColumns, e), get("bends"), ends);
|
|
793
|
+
edgeTrees.push(polyLineEdgeTree(get, path, approximateFor("edge")));
|
|
794
|
+
}
|
|
795
|
+
const out = snapshot.withColumns();
|
|
796
|
+
for (const [table, trees, target] of [
|
|
797
|
+
[out.nodes, nodeTrees, "node"],
|
|
798
|
+
[out.edges, edgeTrees, "edge"]
|
|
799
|
+
]) {
|
|
800
|
+
for (const name2 of yfilesColumns(table)) {
|
|
801
|
+
table.remove(name2);
|
|
802
|
+
}
|
|
803
|
+
const name = freeName(table, GRAPHICS_TYPES[target]);
|
|
804
|
+
table.set(name, trees, {
|
|
805
|
+
dtype: "json",
|
|
806
|
+
nullable: true,
|
|
807
|
+
origin: { format: "graphml", id: null, title: null, type: GRAPHICS_TYPES[target], namespace: "yfiles" }
|
|
808
|
+
});
|
|
809
|
+
}
|
|
810
|
+
const yfiles3 = [...out.graph].filter(
|
|
811
|
+
(col) => col.meta.origin?.namespace === "yfiles" && (col.meta.origin.type ?? "").includes("://")
|
|
812
|
+
);
|
|
813
|
+
for (const col of yfiles3) {
|
|
814
|
+
out.graph.remove(col.meta.name);
|
|
815
|
+
}
|
|
816
|
+
return { snapshot: out, notes: approximated.notes("yEd") };
|
|
817
|
+
}
|
|
818
|
+
export {
|
|
819
|
+
FONT_STYLES as F,
|
|
820
|
+
GRAPHML_STYLE_CAPABILITIES as G,
|
|
821
|
+
YED_SHAPES as Y,
|
|
822
|
+
treeAttr as a,
|
|
823
|
+
treeChild as b,
|
|
824
|
+
treeText as c,
|
|
825
|
+
yedValue as d,
|
|
826
|
+
exactFromBlock as e,
|
|
827
|
+
yedColor as f,
|
|
828
|
+
graphmlStyledExport as g,
|
|
829
|
+
yedSpelled as h,
|
|
830
|
+
isTree as i,
|
|
831
|
+
bendsToPoints as j,
|
|
832
|
+
YED_LINES as k,
|
|
833
|
+
localOf as l,
|
|
834
|
+
canonBends as m,
|
|
835
|
+
flowchartShape as n,
|
|
836
|
+
YED_ARROWS as o,
|
|
837
|
+
readYedStyles as r,
|
|
838
|
+
treeChildren as t,
|
|
839
|
+
valueColumns as v,
|
|
840
|
+
yfilesColumns as y
|
|
841
|
+
};
|
|
842
|
+
//# sourceMappingURL=styles-yed-DAfcIkf7.js.map
|