@graphty/graph-io 0.3.47 → 0.3.49
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-wWjCRzKj.js → approximations-Bzn3L-je.js} +2 -2
- package/dist/chunks/{approximations-wWjCRzKj.js.map → approximations-Bzn3L-je.js.map} +1 -1
- package/dist/chunks/bends-BGXjv_U4.js +129 -0
- package/dist/chunks/bends-BGXjv_U4.js.map +1 -0
- package/dist/chunks/{block-DiGq58c3.js → block-iptrlMBb.js} +947 -134
- package/dist/chunks/block-iptrlMBb.js.map +1 -0
- package/dist/chunks/choose-CczZJaX_.js +717 -0
- package/dist/chunks/choose-CczZJaX_.js.map +1 -0
- package/dist/chunks/codes-BE2xir2k.js +157 -0
- package/dist/chunks/codes-BE2xir2k.js.map +1 -0
- package/dist/chunks/{constants-BKwqelYD.js → constants-CKkYLPtt.js} +2 -2
- package/dist/chunks/{constants-BKwqelYD.js.map → constants-CKkYLPtt.js.map} +1 -1
- package/dist/chunks/context-C3p0RQxR.js +664 -0
- package/dist/chunks/context-C3p0RQxR.js.map +1 -0
- package/dist/chunks/{convert-BcQ8_jMo.js → convert-Ct2zelbQ.js} +7 -2
- package/dist/chunks/convert-Ct2zelbQ.js.map +1 -0
- package/dist/chunks/credentials-DXHx7nwR.js +349 -0
- package/dist/chunks/credentials-DXHx7nwR.js.map +1 -0
- package/dist/chunks/cx-export-Bt6NoqTQ.js +259 -0
- package/dist/chunks/cx-export-Bt6NoqTQ.js.map +1 -0
- package/dist/chunks/descriptor-B28U25x4.js +60 -0
- package/dist/chunks/descriptor-B28U25x4.js.map +1 -0
- package/dist/chunks/descriptor-C-YDhtsn.js +48 -0
- package/dist/chunks/descriptor-C-YDhtsn.js.map +1 -0
- package/dist/chunks/descriptor-DLA5kINx.js +142 -0
- package/dist/chunks/descriptor-DLA5kINx.js.map +1 -0
- package/dist/chunks/{emit-CwU8cUmG.js → emit-BwHQkZle.js} +1690 -103
- package/dist/chunks/emit-BwHQkZle.js.map +1 -0
- package/dist/chunks/{escape-CgzxiYPg.js → escape-CuCIzNMB.js} +12 -12
- package/dist/chunks/{escape-CgzxiYPg.js.map → escape-CuCIzNMB.js.map} +1 -1
- package/dist/chunks/{export-BvqAXCKh.js → export-Cha4dRFz.js} +48 -1780
- package/dist/chunks/export-Cha4dRFz.js.map +1 -0
- package/dist/chunks/{exporter--Mk9gXCJ.js → exporter-BP6otMO6.js} +6 -4
- package/dist/chunks/{exporter--Mk9gXCJ.js.map → exporter-BP6otMO6.js.map} +1 -1
- package/dist/chunks/{exporter-CrDWIyiq.js → exporter-D2CETOMK.js} +1222 -154
- package/dist/chunks/exporter-D2CETOMK.js.map +1 -0
- package/dist/chunks/{exporter-DndFlGSa.js → exporter-D9yMtocA.js} +7 -6
- package/dist/chunks/{exporter-DndFlGSa.js.map → exporter-D9yMtocA.js.map} +1 -1
- package/dist/chunks/exporter-_jrBTnos.js +1009 -0
- package/dist/chunks/exporter-_jrBTnos.js.map +1 -0
- package/dist/chunks/{exporter-CJgfhF-l.js → exporter-nDfxIK5D.js} +9 -7
- package/dist/chunks/{exporter-CJgfhF-l.js.map → exporter-nDfxIK5D.js.map} +1 -1
- package/dist/chunks/format-BXiAb-1h.js +408 -0
- package/dist/chunks/format-BXiAb-1h.js.map +1 -0
- package/dist/chunks/{generic-Dq1ntt9q.js → generic-ymWCETAJ.js} +387 -31
- package/dist/chunks/generic-ymWCETAJ.js.map +1 -0
- package/dist/chunks/{importer-CMmeMWlC.js → importer-B92x1xY5.js} +15 -263
- package/dist/chunks/importer-B92x1xY5.js.map +1 -0
- package/dist/chunks/{importer-DiZRmOQG.js → importer-CT9mJ1nn.js} +328 -90
- package/dist/chunks/importer-CT9mJ1nn.js.map +1 -0
- package/dist/chunks/{importer-COTK9Tsl.js → importer-DaLTjbds.js} +116 -1099
- package/dist/chunks/importer-DaLTjbds.js.map +1 -0
- package/dist/chunks/{importer-iFYPEKaJ.js → importer-GREKMdIf.js} +28 -16
- package/dist/chunks/importer-GREKMdIf.js.map +1 -0
- package/dist/chunks/{importer-BSvfrX_h.js → importer-PqaaKKnY.js} +23 -1016
- package/dist/chunks/importer-PqaaKKnY.js.map +1 -0
- package/dist/chunks/{importer-yh_aBCU6.js → importer-Vn5QvmmJ.js} +66 -12
- package/dist/chunks/importer-Vn5QvmmJ.js.map +1 -0
- package/dist/chunks/{importer-e6LGpqHB.js → importer-vRq4h3j5.js} +1470 -354
- package/dist/chunks/importer-vRq4h3j5.js.map +1 -0
- package/dist/chunks/input-CAxt_aV-.js +1397 -0
- package/dist/chunks/input-CAxt_aV-.js.map +1 -0
- package/dist/chunks/{json-elements-DJZRZ6jd.js → json-elements-Cq76WjnZ.js} +4 -4
- package/dist/chunks/{json-elements-DJZRZ6jd.js.map → json-elements-Cq76WjnZ.js.map} +1 -1
- package/dist/chunks/{lexicon-CT69Kd87.js → lexicon-Clf4QIyl.js} +299 -77
- package/dist/chunks/lexicon-Clf4QIyl.js.map +1 -0
- package/dist/chunks/{ontology-export-G4MqRdux.js → ontology-export-OMo91mb0.js} +4 -3
- package/dist/chunks/{ontology-export-G4MqRdux.js.map → ontology-export-OMo91mb0.js.map} +1 -1
- package/dist/chunks/{records-CiaWZrFH.js → records-NJiYvekn.js} +2 -2
- package/dist/chunks/{records-CiaWZrFH.js.map → records-NJiYvekn.js.map} +1 -1
- package/dist/chunks/{format-BpQBx8MZ.js → report-CwMfYa9J.js} +70 -127
- package/dist/chunks/report-CwMfYa9J.js.map +1 -0
- package/dist/chunks/round-trip-Zm3_ivgq.js +79 -0
- package/dist/chunks/round-trip-Zm3_ivgq.js.map +1 -0
- package/dist/chunks/sigv4-EokFic1V.js +247 -0
- package/dist/chunks/sigv4-EokFic1V.js.map +1 -0
- package/dist/chunks/{styles-BQnsga7p.js → styles-CCs214_3.js} +1300 -168
- package/dist/chunks/styles-CCs214_3.js.map +1 -0
- package/dist/chunks/styles-Cm62yyQX.js +2812 -0
- package/dist/chunks/styles-Cm62yyQX.js.map +1 -0
- package/dist/chunks/styles-DPQQIig4.js +1928 -0
- package/dist/chunks/styles-DPQQIig4.js.map +1 -0
- package/dist/chunks/styles-yed-UMFdNqze.js +1213 -0
- package/dist/chunks/styles-yed-UMFdNqze.js.map +1 -0
- package/dist/chunks/{text-CzJNFOS9.js → text-ystE2bYi.js} +2 -2
- package/dist/chunks/{text-CzJNFOS9.js.map → text-ystE2bYi.js.map} +1 -1
- package/dist/csv.js +7 -5
- package/dist/csv.js.map +1 -1
- package/dist/cx.js +5 -4
- package/dist/cx.js.map +1 -1
- package/dist/cx2.js +2 -2
- package/dist/cys.js +1 -1
- package/dist/dot.js +5 -4
- package/dist/dot.js.map +1 -1
- package/dist/gexf.js +42 -10
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +850 -193
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +1189 -220
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +3 -3
- package/dist/json.js +3 -2
- package/dist/neo4j.js +6 -4
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +1 -1
- package/dist/positions.js +45 -3
- package/dist/positions.js.map +1 -1
- package/dist/sources-cypher.d.ts +1 -0
- package/dist/sources-cypher.js +1351 -0
- package/dist/sources-cypher.js.map +1 -0
- package/dist/sources-ndex.d.ts +1 -0
- package/dist/sources-ndex.js +278 -0
- package/dist/sources-ndex.js.map +1 -0
- package/dist/sources-rest.d.ts +1 -0
- package/dist/sources-rest.js +1377 -0
- package/dist/sources-rest.js.map +1 -0
- package/dist/sources-sparql.d.ts +1 -0
- package/dist/sources-sparql.js +405 -0
- package/dist/sources-sparql.js.map +1 -0
- package/dist/src/common/report.d.ts +6 -3
- package/dist/src/common/report.d.ts.map +1 -1
- package/dist/src/common/report.js +15 -9
- package/dist/src/common/report.js.map +1 -1
- package/dist/src/formats/cx/importer.d.ts.map +1 -1
- package/dist/src/formats/cx/importer.js +5 -1
- package/dist/src/formats/cx/importer.js.map +1 -1
- package/dist/src/formats/cx/styles.d.ts +24 -1
- package/dist/src/formats/cx/styles.d.ts.map +1 -1
- package/dist/src/formats/cx/styles.js +118 -11
- package/dist/src/formats/cx/styles.js.map +1 -1
- package/dist/src/formats/cx2/importer.d.ts.map +1 -1
- package/dist/src/formats/cx2/importer.js +1 -0
- package/dist/src/formats/cx2/importer.js.map +1 -1
- package/dist/src/formats/cx2/styles.d.ts.map +1 -1
- package/dist/src/formats/cx2/styles.js +3 -1
- package/dist/src/formats/cx2/styles.js.map +1 -1
- package/dist/src/formats/cys/importer.d.ts.map +1 -1
- package/dist/src/formats/cys/importer.js +1 -0
- package/dist/src/formats/cys/importer.js.map +1 -1
- package/dist/src/formats/cys/styles.d.ts +2 -0
- package/dist/src/formats/cys/styles.d.ts.map +1 -1
- package/dist/src/formats/cys/styles.js +15 -7
- package/dist/src/formats/cys/styles.js.map +1 -1
- package/dist/src/formats/dot/drawing.d.ts +98 -0
- package/dist/src/formats/dot/drawing.d.ts.map +1 -0
- package/dist/src/formats/dot/drawing.js +734 -0
- package/dist/src/formats/dot/drawing.js.map +1 -0
- package/dist/src/formats/dot/importer.d.ts.map +1 -1
- package/dist/src/formats/dot/importer.js +108 -31
- package/dist/src/formats/dot/importer.js.map +1 -1
- package/dist/src/formats/dot/label-places.d.ts +34 -0
- package/dist/src/formats/dot/label-places.d.ts.map +1 -0
- package/dist/src/formats/dot/label-places.js +179 -0
- package/dist/src/formats/dot/label-places.js.map +1 -0
- package/dist/src/formats/dot/record.d.ts +50 -0
- package/dist/src/formats/dot/record.d.ts.map +1 -0
- package/dist/src/formats/dot/record.js +275 -0
- package/dist/src/formats/dot/record.js.map +1 -0
- package/dist/src/formats/dot/styles.d.ts +62 -2
- package/dist/src/formats/dot/styles.d.ts.map +1 -1
- package/dist/src/formats/dot/styles.js +1457 -120
- package/dist/src/formats/dot/styles.js.map +1 -1
- package/dist/src/formats/gexf/dialog-metrics.d.ts +15 -0
- package/dist/src/formats/gexf/dialog-metrics.d.ts.map +1 -0
- package/dist/src/formats/gexf/dialog-metrics.js +59 -0
- package/dist/src/formats/gexf/dialog-metrics.js.map +1 -0
- package/dist/src/formats/gexf/importer.d.ts +7 -0
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +41 -5
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gexf/preview.d.ts +77 -0
- package/dist/src/formats/gexf/preview.d.ts.map +1 -0
- package/dist/src/formats/gexf/preview.js +191 -0
- package/dist/src/formats/gexf/preview.js.map +1 -0
- package/dist/src/formats/gexf/schema.d.ts.map +1 -1
- package/dist/src/formats/gexf/schema.js +2 -1
- package/dist/src/formats/gexf/schema.js.map +1 -1
- package/dist/src/formats/gexf/styles.d.ts +60 -16
- package/dist/src/formats/gexf/styles.d.ts.map +1 -1
- package/dist/src/formats/gexf/styles.js +883 -131
- package/dist/src/formats/gexf/styles.js.map +1 -1
- package/dist/src/formats/gml/importer.d.ts +5 -2
- package/dist/src/formats/gml/importer.d.ts.map +1 -1
- package/dist/src/formats/gml/importer.js +258 -71
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/index.d.ts +1 -1
- package/dist/src/formats/gml/index.d.ts.map +1 -1
- package/dist/src/formats/gml/index.js +1 -1
- package/dist/src/formats/gml/index.js.map +1 -1
- package/dist/src/formats/gml/positions.d.ts +7 -0
- package/dist/src/formats/gml/positions.d.ts.map +1 -1
- package/dist/src/formats/gml/positions.js +29 -7
- package/dist/src/formats/gml/positions.js.map +1 -1
- package/dist/src/formats/gml/styles.d.ts.map +1 -1
- package/dist/src/formats/gml/styles.js +756 -103
- package/dist/src/formats/gml/styles.js.map +1 -1
- package/dist/src/formats/graphml/styles-plain.d.ts.map +1 -1
- package/dist/src/formats/graphml/styles-plain.js +8 -12
- package/dist/src/formats/graphml/styles-plain.js.map +1 -1
- package/dist/src/formats/graphml/styles-yed.d.ts +21 -15
- package/dist/src/formats/graphml/styles-yed.d.ts.map +1 -1
- package/dist/src/formats/graphml/styles-yed.js +749 -148
- package/dist/src/formats/graphml/styles-yed.js.map +1 -1
- package/dist/src/formats/graphml/styles-yfiles3.d.ts +1 -1
- package/dist/src/formats/graphml/styles-yfiles3.d.ts.map +1 -1
- package/dist/src/formats/graphml/styles-yfiles3.js +429 -64
- package/dist/src/formats/graphml/styles-yfiles3.js.map +1 -1
- package/dist/src/formats/graphml/yfiles.d.ts +3 -3
- package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
- package/dist/src/formats/graphml/yfiles.js +16 -6
- package/dist/src/formats/graphml/yfiles.js.map +1 -1
- package/dist/src/formats/json/dialect.d.ts +3 -2
- package/dist/src/formats/json/dialect.d.ts.map +1 -1
- package/dist/src/formats/json/dialect.js +39 -5
- package/dist/src/formats/json/dialect.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts +13 -2
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +42 -6
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/index.d.ts +1 -1
- package/dist/src/formats/json/index.d.ts.map +1 -1
- package/dist/src/formats/json/index.js +1 -1
- package/dist/src/formats/json/index.js.map +1 -1
- package/dist/src/formats/json/positions.d.ts +5 -2
- package/dist/src/formats/json/positions.d.ts.map +1 -1
- package/dist/src/formats/json/positions.js +20 -4
- package/dist/src/formats/json/positions.js.map +1 -1
- package/dist/src/formats/json/styles.d.ts +12 -1
- package/dist/src/formats/json/styles.d.ts.map +1 -1
- package/dist/src/formats/json/styles.js +1755 -136
- package/dist/src/formats/json/styles.js.map +1 -1
- package/dist/src/formats/pajek/draw.d.ts +96 -0
- package/dist/src/formats/pajek/draw.d.ts.map +1 -0
- package/dist/src/formats/pajek/draw.js +372 -0
- package/dist/src/formats/pajek/draw.js.map +1 -0
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +70 -51
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.d.ts +9 -0
- package/dist/src/formats/pajek/importer.d.ts.map +1 -1
- package/dist/src/formats/pajek/importer.js +233 -102
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/index.d.ts +1 -0
- package/dist/src/formats/pajek/index.d.ts.map +1 -1
- package/dist/src/formats/pajek/index.js.map +1 -1
- package/dist/src/formats/pajek/styles.d.ts +15 -7
- package/dist/src/formats/pajek/styles.d.ts.map +1 -1
- package/dist/src/formats/pajek/styles.js +1279 -114
- package/dist/src/formats/pajek/styles.js.map +1 -1
- package/dist/src/formats/pajek/syntax.d.ts +10 -1
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +26 -2
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/emit.d.ts +1 -0
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
- package/dist/src/formats/xgmml/emit.js +65 -5
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/styles.d.ts +23 -3
- package/dist/src/formats/xgmml/styles.d.ts.map +1 -1
- package/dist/src/formats/xgmml/styles.js +278 -60
- package/dist/src/formats/xgmml/styles.js.map +1 -1
- package/dist/src/index.d.ts +10 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +11 -2
- package/dist/src/index.js.map +1 -1
- package/dist/src/positions/convert.d.ts.map +1 -1
- package/dist/src/positions/convert.js +11 -1
- package/dist/src/positions/convert.js.map +1 -1
- package/dist/src/positions/extract.d.ts.map +1 -1
- package/dist/src/positions/extract.js +53 -1
- package/dist/src/positions/extract.js.map +1 -1
- package/dist/src/positions/index.d.ts +1 -1
- package/dist/src/positions/index.d.ts.map +1 -1
- package/dist/src/positions/types.d.ts +59 -0
- package/dist/src/positions/types.d.ts.map +1 -1
- package/dist/src/registry.d.ts +173 -1
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +196 -1
- package/dist/src/registry.js.map +1 -1
- package/dist/src/sources/builtins.d.ts +11 -0
- package/dist/src/sources/builtins.d.ts.map +1 -0
- package/dist/src/sources/builtins.js +53 -0
- package/dist/src/sources/builtins.js.map +1 -0
- package/dist/src/sources/codes.d.ts +230 -0
- package/dist/src/sources/codes.d.ts.map +1 -0
- package/dist/src/sources/codes.js +58 -0
- package/dist/src/sources/codes.js.map +1 -0
- package/dist/src/sources/context.d.ts +112 -0
- package/dist/src/sources/context.d.ts.map +1 -0
- package/dist/src/sources/context.js +740 -0
- package/dist/src/sources/context.js.map +1 -0
- package/dist/src/sources/credentials.d.ts +179 -0
- package/dist/src/sources/credentials.d.ts.map +1 -0
- package/dist/src/sources/credentials.js +301 -0
- package/dist/src/sources/credentials.js.map +1 -0
- package/dist/src/sources/cypher/descriptor.d.ts +21 -0
- package/dist/src/sources/cypher/descriptor.d.ts.map +1 -0
- package/dist/src/sources/cypher/descriptor.js +124 -0
- package/dist/src/sources/cypher/descriptor.js.map +1 -0
- package/dist/src/sources/cypher/flatten.d.ts +72 -0
- package/dist/src/sources/cypher/flatten.d.ts.map +1 -0
- package/dist/src/sources/cypher/flatten.js +279 -0
- package/dist/src/sources/cypher/flatten.js.map +1 -0
- package/dist/src/sources/cypher/index.d.ts +33 -0
- package/dist/src/sources/cypher/index.d.ts.map +1 -0
- package/dist/src/sources/cypher/index.js +511 -0
- package/dist/src/sources/cypher/index.js.map +1 -0
- package/dist/src/sources/cypher/params.d.ts +40 -0
- package/dist/src/sources/cypher/params.d.ts.map +1 -0
- package/dist/src/sources/cypher/params.js +6 -0
- package/dist/src/sources/cypher/params.js.map +1 -0
- package/dist/src/sources/cypher/profiles.d.ts +44 -0
- package/dist/src/sources/cypher/profiles.d.ts.map +1 -0
- package/dist/src/sources/cypher/profiles.js +61 -0
- package/dist/src/sources/cypher/profiles.js.map +1 -0
- package/dist/src/sources/cypher/query-builder.d.ts +123 -0
- package/dist/src/sources/cypher/query-builder.d.ts.map +1 -0
- package/dist/src/sources/cypher/query-builder.js +267 -0
- package/dist/src/sources/cypher/query-builder.js.map +1 -0
- package/dist/src/sources/cypher/transports/bolt.d.ts +21 -0
- package/dist/src/sources/cypher/transports/bolt.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/bolt.js +185 -0
- package/dist/src/sources/cypher/transports/bolt.js.map +1 -0
- package/dist/src/sources/cypher/transports/neptune-analytics.d.ts +15 -0
- package/dist/src/sources/cypher/transports/neptune-analytics.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/neptune-analytics.js +38 -0
- package/dist/src/sources/cypher/transports/neptune-analytics.js.map +1 -0
- package/dist/src/sources/cypher/transports/neptune-https.d.ts +31 -0
- package/dist/src/sources/cypher/transports/neptune-https.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/neptune-https.js +104 -0
- package/dist/src/sources/cypher/transports/neptune-https.js.map +1 -0
- package/dist/src/sources/cypher/transports/query-api.d.ts +14 -0
- package/dist/src/sources/cypher/transports/query-api.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/query-api.js +80 -0
- package/dist/src/sources/cypher/transports/query-api.js.map +1 -0
- package/dist/src/sources/cypher/transports/transport.d.ts +78 -0
- package/dist/src/sources/cypher/transports/transport.d.ts.map +1 -0
- package/dist/src/sources/cypher/transports/transport.js +77 -0
- package/dist/src/sources/cypher/transports/transport.js.map +1 -0
- package/dist/src/sources/cypher/types-map.d.ts +91 -0
- package/dist/src/sources/cypher/types-map.d.ts.map +1 -0
- package/dist/src/sources/cypher/types-map.js +306 -0
- package/dist/src/sources/cypher/types-map.js.map +1 -0
- package/dist/src/sources/define.d.ts +47 -0
- package/dist/src/sources/define.d.ts.map +1 -0
- package/dist/src/sources/define.js +173 -0
- package/dist/src/sources/define.js.map +1 -0
- package/dist/src/sources/fail.d.ts +33 -0
- package/dist/src/sources/fail.d.ts.map +1 -0
- package/dist/src/sources/fail.js +49 -0
- package/dist/src/sources/fail.js.map +1 -0
- package/dist/src/sources/ids.d.ts +69 -0
- package/dist/src/sources/ids.d.ts.map +1 -0
- package/dist/src/sources/ids.js +69 -0
- package/dist/src/sources/ids.js.map +1 -0
- package/dist/src/sources/ndex/client.d.ts +31 -0
- package/dist/src/sources/ndex/client.d.ts.map +1 -0
- package/dist/src/sources/ndex/client.js +90 -0
- package/dist/src/sources/ndex/client.js.map +1 -0
- package/dist/src/sources/ndex/descriptor.d.ts +10 -0
- package/dist/src/sources/ndex/descriptor.d.ts.map +1 -0
- package/dist/src/sources/ndex/descriptor.js +55 -0
- package/dist/src/sources/ndex/descriptor.js.map +1 -0
- package/dist/src/sources/ndex/expand.d.ts +20 -0
- package/dist/src/sources/ndex/expand.d.ts.map +1 -0
- package/dist/src/sources/ndex/expand.js +87 -0
- package/dist/src/sources/ndex/expand.js.map +1 -0
- package/dist/src/sources/ndex/index.d.ts +25 -0
- package/dist/src/sources/ndex/index.d.ts.map +1 -0
- package/dist/src/sources/ndex/index.js +191 -0
- package/dist/src/sources/ndex/index.js.map +1 -0
- package/dist/src/sources/ndex/params.d.ts +17 -0
- package/dist/src/sources/ndex/params.d.ts.map +1 -0
- package/dist/src/sources/ndex/params.js +6 -0
- package/dist/src/sources/ndex/params.js.map +1 -0
- package/dist/src/sources/ndex/share-url.d.ts +40 -0
- package/dist/src/sources/ndex/share-url.d.ts.map +1 -0
- package/dist/src/sources/ndex/share-url.js +64 -0
- package/dist/src/sources/ndex/share-url.js.map +1 -0
- package/dist/src/sources/params.d.ts +31 -0
- package/dist/src/sources/params.d.ts.map +1 -0
- package/dist/src/sources/params.js +6 -0
- package/dist/src/sources/params.js.map +1 -0
- package/dist/src/sources/registry.d.ts +118 -0
- package/dist/src/sources/registry.d.ts.map +1 -0
- package/dist/src/sources/registry.js +193 -0
- package/dist/src/sources/registry.js.map +1 -0
- package/dist/src/sources/rest/descriptor.d.ts +16 -0
- package/dist/src/sources/rest/descriptor.d.ts.map +1 -0
- package/dist/src/sources/rest/descriptor.js +76 -0
- package/dist/src/sources/rest/descriptor.js.map +1 -0
- package/dist/src/sources/rest/index.d.ts +14 -0
- package/dist/src/sources/rest/index.d.ts.map +1 -0
- package/dist/src/sources/rest/index.js +13 -0
- package/dist/src/sources/rest/index.js.map +1 -0
- package/dist/src/sources/rest/mapping.d.ts +30 -0
- package/dist/src/sources/rest/mapping.d.ts.map +1 -0
- package/dist/src/sources/rest/mapping.js +362 -0
- package/dist/src/sources/rest/mapping.js.map +1 -0
- package/dist/src/sources/rest/openalex.d.ts +27 -0
- package/dist/src/sources/rest/openalex.d.ts.map +1 -0
- package/dist/src/sources/rest/openalex.js +269 -0
- package/dist/src/sources/rest/openalex.js.map +1 -0
- package/dist/src/sources/rest/paging.d.ts +53 -0
- package/dist/src/sources/rest/paging.d.ts.map +1 -0
- package/dist/src/sources/rest/paging.js +138 -0
- package/dist/src/sources/rest/paging.js.map +1 -0
- package/dist/src/sources/rest/params.d.ts +216 -0
- package/dist/src/sources/rest/params.d.ts.map +1 -0
- package/dist/src/sources/rest/params.js +7 -0
- package/dist/src/sources/rest/params.js.map +1 -0
- package/dist/src/sources/rest/records.d.ts +41 -0
- package/dist/src/sources/rest/records.d.ts.map +1 -0
- package/dist/src/sources/rest/records.js +240 -0
- package/dist/src/sources/rest/records.js.map +1 -0
- package/dist/src/sources/rest/samples/deps-dev.d.ts +10 -0
- package/dist/src/sources/rest/samples/deps-dev.d.ts.map +1 -0
- package/dist/src/sources/rest/samples/deps-dev.js +47 -0
- package/dist/src/sources/rest/samples/deps-dev.js.map +1 -0
- package/dist/src/sources/rest/samples/string.d.ts +9 -0
- package/dist/src/sources/rest/samples/string.d.ts.map +1 -0
- package/dist/src/sources/rest/samples/string.js +42 -0
- package/dist/src/sources/rest/samples/string.js.map +1 -0
- package/dist/src/sources/rest/selectors.d.ts +41 -0
- package/dist/src/sources/rest/selectors.d.ts.map +1 -0
- package/dist/src/sources/rest/selectors.js +81 -0
- package/dist/src/sources/rest/selectors.js.map +1 -0
- package/dist/src/sources/rest/source.d.ts +67 -0
- package/dist/src/sources/rest/source.d.ts.map +1 -0
- package/dist/src/sources/rest/source.js +650 -0
- package/dist/src/sources/rest/source.js.map +1 -0
- package/dist/src/sources/rest/templates.d.ts +38 -0
- package/dist/src/sources/rest/templates.d.ts.map +1 -0
- package/dist/src/sources/rest/templates.js +125 -0
- package/dist/src/sources/rest/templates.js.map +1 -0
- package/dist/src/sources/run.d.ts +93 -0
- package/dist/src/sources/run.d.ts.map +1 -0
- package/dist/src/sources/run.js +673 -0
- package/dist/src/sources/run.js.map +1 -0
- package/dist/src/sources/sha256.d.ts +12 -0
- package/dist/src/sources/sha256.d.ts.map +1 -0
- package/dist/src/sources/sha256.js +95 -0
- package/dist/src/sources/sha256.js.map +1 -0
- package/dist/src/sources/sigv4.d.ts +26 -0
- package/dist/src/sources/sigv4.d.ts.map +1 -0
- package/dist/src/sources/sigv4.js +184 -0
- package/dist/src/sources/sigv4.js.map +1 -0
- package/dist/src/sources/sparql/descriptor.d.ts +10 -0
- package/dist/src/sources/sparql/descriptor.d.ts.map +1 -0
- package/dist/src/sources/sparql/descriptor.js +64 -0
- package/dist/src/sources/sparql/descriptor.js.map +1 -0
- package/dist/src/sources/sparql/index.d.ts +28 -0
- package/dist/src/sources/sparql/index.d.ts.map +1 -0
- package/dist/src/sources/sparql/index.js +314 -0
- package/dist/src/sources/sparql/index.js.map +1 -0
- package/dist/src/sources/sparql/ntriples.d.ts +69 -0
- package/dist/src/sources/sparql/ntriples.d.ts.map +1 -0
- package/dist/src/sources/sparql/ntriples.js +180 -0
- package/dist/src/sources/sparql/ntriples.js.map +1 -0
- package/dist/src/sources/sparql/params.d.ts +27 -0
- package/dist/src/sources/sparql/params.d.ts.map +1 -0
- package/dist/src/sources/sparql/params.js +5 -0
- package/dist/src/sources/sparql/params.js.map +1 -0
- package/dist/src/sources/sparql/query.d.ts +72 -0
- package/dist/src/sources/sparql/query.d.ts.map +1 -0
- package/dist/src/sources/sparql/query.js +113 -0
- package/dist/src/sources/sparql/query.js.map +1 -0
- package/dist/src/sources/testing.d.ts +96 -0
- package/dist/src/sources/testing.d.ts.map +1 -0
- package/dist/src/sources/testing.js +138 -0
- package/dist/src/sources/testing.js.map +1 -0
- package/dist/src/sources/types.d.ts +696 -0
- package/dist/src/sources/types.d.ts.map +1 -0
- package/dist/src/sources/types.js +10 -0
- package/dist/src/sources/types.js.map +1 -0
- package/dist/src/styles/annotations.d.ts +61 -5
- package/dist/src/styles/annotations.d.ts.map +1 -1
- package/dist/src/styles/annotations.js +130 -22
- package/dist/src/styles/annotations.js.map +1 -1
- package/dist/src/styles/canon/bends.d.ts +46 -0
- package/dist/src/styles/canon/bends.d.ts.map +1 -1
- package/dist/src/styles/canon/bends.js +123 -0
- package/dist/src/styles/canon/bends.js.map +1 -1
- package/dist/src/styles/canon/color-tables.d.ts +6 -1
- package/dist/src/styles/canon/color-tables.d.ts.map +1 -1
- package/dist/src/styles/canon/color-tables.js +10 -4
- package/dist/src/styles/canon/color-tables.js.map +1 -1
- package/dist/src/styles/canon/color.d.ts +3 -1
- package/dist/src/styles/canon/color.d.ts.map +1 -1
- package/dist/src/styles/canon/color.js +103 -3
- package/dist/src/styles/canon/color.js.map +1 -1
- package/dist/src/styles/canon/enums.d.ts +2 -2
- package/dist/src/styles/canon/enums.d.ts.map +1 -1
- package/dist/src/styles/canon/enums.js +82 -7
- package/dist/src/styles/canon/enums.js.map +1 -1
- package/dist/src/styles/canon/graphviz.d.ts +12 -3
- package/dist/src/styles/canon/graphviz.d.ts.map +1 -1
- package/dist/src/styles/canon/graphviz.js +57 -9
- package/dist/src/styles/canon/graphviz.js.map +1 -1
- package/dist/src/styles/canon/number.d.ts +8 -0
- package/dist/src/styles/canon/number.d.ts.map +1 -1
- package/dist/src/styles/canon/number.js +18 -0
- package/dist/src/styles/canon/number.js.map +1 -1
- package/dist/src/styles/canon/text.d.ts +29 -2
- package/dist/src/styles/canon/text.d.ts.map +1 -1
- package/dist/src/styles/canon/text.js +156 -16
- package/dist/src/styles/canon/text.js.map +1 -1
- package/dist/src/styles/codes.d.ts +2 -0
- package/dist/src/styles/codes.d.ts.map +1 -1
- package/dist/src/styles/codes.js +2 -0
- package/dist/src/styles/codes.js.map +1 -1
- package/dist/src/styles/cyjs/cascade.d.ts.map +1 -1
- package/dist/src/styles/cyjs/cascade.js +1037 -35
- package/dist/src/styles/cyjs/cascade.js.map +1 -1
- package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -1
- package/dist/src/styles/cyjs/defaults-table.js +5 -0
- package/dist/src/styles/cyjs/defaults-table.js.map +1 -1
- package/dist/src/styles/cyjs/emit.d.ts.map +1 -1
- package/dist/src/styles/cyjs/emit.js +216 -12
- package/dist/src/styles/cyjs/emit.js.map +1 -1
- package/dist/src/styles/cyjs/face.d.ts +20 -0
- package/dist/src/styles/cyjs/face.d.ts.map +1 -0
- package/dist/src/styles/cyjs/face.js +332 -0
- package/dist/src/styles/cyjs/face.js.map +1 -0
- package/dist/src/styles/cyjs/mappers.d.ts +48 -2
- package/dist/src/styles/cyjs/mappers.d.ts.map +1 -1
- package/dist/src/styles/cyjs/mappers.js +463 -26
- package/dist/src/styles/cyjs/mappers.js.map +1 -1
- package/dist/src/styles/cyjs/routes.d.ts +53 -0
- package/dist/src/styles/cyjs/routes.d.ts.map +1 -0
- package/dist/src/styles/cyjs/routes.js +360 -0
- package/dist/src/styles/cyjs/routes.js.map +1 -0
- package/dist/src/styles/cytoscape/charts.d.ts +23 -0
- package/dist/src/styles/cytoscape/charts.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/charts.js +560 -0
- package/dist/src/styles/cytoscape/charts.js.map +1 -0
- package/dist/src/styles/cytoscape/emit.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/emit.js +204 -44
- package/dist/src/styles/cytoscape/emit.js.map +1 -1
- package/dist/src/styles/cytoscape/lexicon.d.ts +97 -3
- package/dist/src/styles/cytoscape/lexicon.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/lexicon.js +413 -79
- package/dist/src/styles/cytoscape/lexicon.js.map +1 -1
- package/dist/src/styles/cytoscape/mappings.d.ts +30 -0
- package/dist/src/styles/cytoscape/mappings.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/mappings.js +92 -0
- package/dist/src/styles/cytoscape/mappings.js.map +1 -1
- package/dist/src/styles/cytoscape/resolve.d.ts +46 -3
- package/dist/src/styles/cytoscape/resolve.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/resolve.js +632 -22
- package/dist/src/styles/cytoscape/resolve.js.map +1 -1
- package/dist/src/styles/cytoscape/translate.d.ts.map +1 -1
- package/dist/src/styles/cytoscape/translate.js +10 -10
- package/dist/src/styles/cytoscape/translate.js.map +1 -1
- package/dist/src/styles/defaults.d.ts +50 -0
- package/dist/src/styles/defaults.d.ts.map +1 -1
- package/dist/src/styles/defaults.js +315 -37
- package/dist/src/styles/defaults.js.map +1 -1
- package/dist/src/styles/index.d.ts +4 -3
- package/dist/src/styles/index.d.ts.map +1 -1
- package/dist/src/styles/index.js +3 -2
- package/dist/src/styles/index.js.map +1 -1
- package/dist/src/styles/internal.d.ts +1 -0
- package/dist/src/styles/internal.d.ts.map +1 -1
- package/dist/src/styles/internal.js +1 -0
- package/dist/src/styles/internal.js.map +1 -1
- package/dist/src/styles/io/block.d.ts.map +1 -1
- package/dist/src/styles/io/block.js +9 -0
- package/dist/src/styles/io/block.js.map +1 -1
- package/dist/src/styles/io/generic.d.ts.map +1 -1
- package/dist/src/styles/io/generic.js +56 -16
- package/dist/src/styles/io/generic.js.map +1 -1
- package/dist/src/styles/io/round-trip.d.ts +56 -0
- package/dist/src/styles/io/round-trip.d.ts.map +1 -0
- package/dist/src/styles/io/round-trip.js +138 -0
- package/dist/src/styles/io/round-trip.js.map +1 -0
- package/dist/src/styles/io/writer.d.ts.map +1 -1
- package/dist/src/styles/io/writer.js +13 -4
- package/dist/src/styles/io/writer.js.map +1 -1
- package/dist/src/styles/notes.d.ts.map +1 -1
- package/dist/src/styles/notes.js +1 -0
- package/dist/src/styles/notes.js.map +1 -1
- package/dist/src/styles/plan/features.d.ts +1 -1
- package/dist/src/styles/plan/features.d.ts.map +1 -1
- package/dist/src/styles/plan/features.js +22 -2
- package/dist/src/styles/plan/features.js.map +1 -1
- package/dist/src/styles/plan/index.d.ts +1 -1
- package/dist/src/styles/plan/index.d.ts.map +1 -1
- package/dist/src/styles/plan/index.js +1 -1
- package/dist/src/styles/plan/index.js.map +1 -1
- package/dist/src/styles/plan/plan.d.ts.map +1 -1
- package/dist/src/styles/plan/plan.js +61 -4
- package/dist/src/styles/plan/plan.js.map +1 -1
- package/dist/src/styles/plan/resolve.d.ts +13 -1
- package/dist/src/styles/plan/resolve.d.ts.map +1 -1
- package/dist/src/styles/plan/resolve.js +53 -6
- package/dist/src/styles/plan/resolve.js.map +1 -1
- package/dist/src/styles/slots.d.ts +14 -0
- package/dist/src/styles/slots.d.ts.map +1 -0
- package/dist/src/styles/slots.js +20 -0
- package/dist/src/styles/slots.js.map +1 -0
- package/dist/src/styles/types.d.ts +638 -5
- package/dist/src/styles/types.d.ts.map +1 -1
- package/dist/src/styles/vocabulary.d.ts +3 -2
- package/dist/src/styles/vocabulary.d.ts.map +1 -1
- package/dist/src/styles/vocabulary.js +218 -1
- package/dist/src/styles/vocabulary.js.map +1 -1
- package/dist/src/types.d.ts +19 -5
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/styles.js +29 -238
- package/dist/styles.js.map +1 -1
- package/dist/xgmml.js +3 -3
- package/docs/samples/people.json +6 -0
- package/package.json +53 -8
- package/src/common/report.ts +27 -7
- package/src/formats/cx/importer.ts +6 -1
- package/src/formats/cx/styles.ts +144 -9
- package/src/formats/cx2/importer.ts +1 -0
- package/src/formats/cx2/styles.ts +3 -1
- package/src/formats/cys/importer.ts +1 -0
- package/src/formats/cys/styles.ts +27 -5
- package/src/formats/dot/drawing.ts +799 -0
- package/src/formats/dot/importer.ts +120 -35
- package/src/formats/dot/label-places.ts +228 -0
- package/src/formats/dot/record.ts +336 -0
- package/src/formats/dot/styles.ts +1657 -154
- package/src/formats/gexf/dialog-metrics.ts +61 -0
- package/src/formats/gexf/importer.ts +50 -5
- package/src/formats/gexf/preview.ts +217 -0
- package/src/formats/gexf/schema.ts +2 -1
- package/src/formats/gexf/styles.ts +1144 -142
- package/src/formats/gml/importer.ts +291 -76
- package/src/formats/gml/index.ts +1 -1
- package/src/formats/gml/positions.ts +29 -7
- package/src/formats/gml/styles.ts +854 -111
- package/src/formats/graphml/styles-plain.ts +8 -23
- package/src/formats/graphml/styles-yed.ts +821 -159
- package/src/formats/graphml/styles-yfiles3.ts +485 -63
- package/src/formats/graphml/yfiles.ts +19 -6
- package/src/formats/json/dialect.ts +41 -5
- package/src/formats/json/importer.ts +59 -7
- package/src/formats/json/index.ts +1 -0
- package/src/formats/json/positions.ts +22 -5
- package/src/formats/json/styles.ts +2041 -185
- package/src/formats/pajek/draw.ts +458 -0
- package/src/formats/pajek/exporter.ts +81 -49
- package/src/formats/pajek/importer.ts +278 -103
- package/src/formats/pajek/index.ts +1 -0
- package/src/formats/pajek/styles.ts +1382 -133
- package/src/formats/pajek/syntax.ts +27 -2
- package/src/formats/xgmml/emit.ts +73 -5
- package/src/formats/xgmml/styles.ts +331 -71
- package/src/index.ts +94 -0
- package/src/positions/convert.ts +12 -1
- package/src/positions/extract.ts +55 -1
- package/src/positions/index.ts +1 -0
- package/src/positions/types.ts +60 -0
- package/src/registry.ts +326 -1
- package/src/sources/builtins.ts +63 -0
- package/src/sources/codes.ts +235 -0
- package/src/sources/context.ts +894 -0
- package/src/sources/credentials.ts +409 -0
- package/src/sources/cypher/descriptor.ts +131 -0
- package/src/sources/cypher/flatten.ts +323 -0
- package/src/sources/cypher/index.ts +628 -0
- package/src/sources/cypher/params.ts +41 -0
- package/src/sources/cypher/profiles.ts +78 -0
- package/src/sources/cypher/query-builder.ts +327 -0
- package/src/sources/cypher/transports/bolt.ts +228 -0
- package/src/sources/cypher/transports/neptune-analytics.ts +41 -0
- package/src/sources/cypher/transports/neptune-https.ts +122 -0
- package/src/sources/cypher/transports/query-api.ts +100 -0
- package/src/sources/cypher/transports/transport.ts +139 -0
- package/src/sources/cypher/types-map.ts +418 -0
- package/src/sources/define.ts +195 -0
- package/src/sources/fail.ts +70 -0
- package/src/sources/ids.ts +80 -0
- package/src/sources/ndex/client.ts +102 -0
- package/src/sources/ndex/descriptor.ts +64 -0
- package/src/sources/ndex/expand.ts +100 -0
- package/src/sources/ndex/index.ts +235 -0
- package/src/sources/ndex/params.ts +17 -0
- package/src/sources/ndex/share-url.ts +84 -0
- package/src/sources/params.ts +32 -0
- package/src/sources/registry.ts +325 -0
- package/src/sources/rest/descriptor.ts +79 -0
- package/src/sources/rest/index.ts +22 -0
- package/src/sources/rest/mapping.ts +401 -0
- package/src/sources/rest/openalex.ts +288 -0
- package/src/sources/rest/paging.ts +180 -0
- package/src/sources/rest/params.ts +243 -0
- package/src/sources/rest/records.ts +289 -0
- package/src/sources/rest/samples/deps-dev.ts +49 -0
- package/src/sources/rest/samples/string.ts +44 -0
- package/src/sources/rest/selectors.ts +91 -0
- package/src/sources/rest/source.ts +776 -0
- package/src/sources/rest/templates.ts +151 -0
- package/src/sources/run.ts +793 -0
- package/src/sources/sha256.ts +99 -0
- package/src/sources/sigv4.ts +209 -0
- package/src/sources/sparql/descriptor.ts +67 -0
- package/src/sources/sparql/index.ts +356 -0
- package/src/sources/sparql/ntriples.ts +219 -0
- package/src/sources/sparql/params.ts +28 -0
- package/src/sources/sparql/query.ts +162 -0
- package/src/sources/testing.ts +210 -0
- package/src/sources/types.ts +776 -0
- package/src/styles/annotations.ts +201 -27
- package/src/styles/canon/bends.ts +137 -0
- package/src/styles/canon/color-tables.ts +10 -4
- package/src/styles/canon/color.ts +105 -3
- package/src/styles/canon/enums.ts +99 -8
- package/src/styles/canon/graphviz.ts +71 -10
- package/src/styles/canon/number.ts +19 -0
- package/src/styles/canon/text.ts +187 -16
- package/src/styles/codes.ts +2 -0
- package/src/styles/cyjs/cascade.ts +1193 -38
- package/src/styles/cyjs/defaults-table.ts +5 -0
- package/src/styles/cyjs/emit.ts +247 -16
- package/src/styles/cyjs/face.ts +372 -0
- package/src/styles/cyjs/mappers.ts +498 -28
- package/src/styles/cyjs/routes.ts +432 -0
- package/src/styles/cytoscape/charts.ts +684 -0
- package/src/styles/cytoscape/emit.ts +220 -44
- package/src/styles/cytoscape/lexicon.ts +459 -80
- package/src/styles/cytoscape/mappings.ts +108 -0
- package/src/styles/cytoscape/resolve.ts +763 -23
- package/src/styles/cytoscape/translate.ts +11 -11
- package/src/styles/defaults.ts +436 -38
- package/src/styles/index.ts +5 -0
- package/src/styles/internal.ts +1 -0
- package/src/styles/io/block.ts +10 -0
- package/src/styles/io/generic.ts +79 -23
- package/src/styles/io/round-trip.ts +202 -0
- package/src/styles/io/writer.ts +14 -4
- package/src/styles/notes.ts +1 -0
- package/src/styles/plan/features.ts +23 -2
- package/src/styles/plan/index.ts +1 -1
- package/src/styles/plan/plan.ts +69 -5
- package/src/styles/plan/resolve.ts +61 -6
- package/src/styles/slots.ts +25 -0
- package/src/styles/types.ts +658 -4
- package/src/styles/vocabulary.ts +226 -3
- package/src/types.ts +19 -5
- package/dist/chunks/block-DiGq58c3.js.map +0 -1
- package/dist/chunks/choose--jM0yYCo.js +0 -57
- package/dist/chunks/choose--jM0yYCo.js.map +0 -1
- package/dist/chunks/convert-BcQ8_jMo.js.map +0 -1
- package/dist/chunks/emit-CwU8cUmG.js.map +0 -1
- package/dist/chunks/export-BvqAXCKh.js.map +0 -1
- package/dist/chunks/exporter-CrDWIyiq.js.map +0 -1
- package/dist/chunks/format-BpQBx8MZ.js.map +0 -1
- package/dist/chunks/generic-Dq1ntt9q.js.map +0 -1
- package/dist/chunks/importer-BSvfrX_h.js.map +0 -1
- package/dist/chunks/importer-CMmeMWlC.js.map +0 -1
- package/dist/chunks/importer-COTK9Tsl.js.map +0 -1
- package/dist/chunks/importer-DiZRmOQG.js.map +0 -1
- package/dist/chunks/importer-e6LGpqHB.js.map +0 -1
- package/dist/chunks/importer-iFYPEKaJ.js.map +0 -1
- package/dist/chunks/importer-yh_aBCU6.js.map +0 -1
- package/dist/chunks/lexicon-CT69Kd87.js.map +0 -1
- package/dist/chunks/styles-BQnsga7p.js.map +0 -1
- package/dist/chunks/styles-D3fRphrO.js +0 -690
- package/dist/chunks/styles-D3fRphrO.js.map +0 -1
- package/dist/chunks/styles-yed-BF5x3_Y5.js +0 -842
- package/dist/chunks/styles-yed-BF5x3_Y5.js.map +0 -1
- package/dist/chunks/writer-DMKvthQE.js +0 -448
- package/dist/chunks/writer-DMKvthQE.js.map +0 -1
package/dist/styles.js
CHANGED
|
@@ -1,226 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
const CYTOSCAPE_ANNOTATIONS_COLUMN = "__Annotations";
|
|
8
|
-
const TYPE_PREFIX = "org.cytoscape.view.presentation.annotations.";
|
|
9
|
-
const SHAPES = /* @__PURE__ */ new Map([
|
|
10
|
-
["rectangle", "rectangle"],
|
|
11
|
-
["roundedrectangle", "round-rectangle"],
|
|
12
|
-
["rounded_rectangle", "round-rectangle"],
|
|
13
|
-
["ellipse", "ellipse"],
|
|
14
|
-
["triangle", "triangle"],
|
|
15
|
-
["diamond", "diamond"],
|
|
16
|
-
["pentagon", "pentagon"],
|
|
17
|
-
["hexagon", "hexagon"],
|
|
18
|
-
["octagon", "octagon"],
|
|
19
|
-
["parallelogram", "parallelogram"],
|
|
20
|
-
["star5", "star"],
|
|
21
|
-
["star6", "star"]
|
|
22
|
-
]);
|
|
23
|
-
const ARROW_ORDER = [
|
|
24
|
-
"circle",
|
|
25
|
-
"triangle",
|
|
26
|
-
"vee",
|
|
27
|
-
"diamond",
|
|
28
|
-
"triangle-open",
|
|
29
|
-
"none",
|
|
30
|
-
"tee",
|
|
31
|
-
"triangle",
|
|
32
|
-
"triangle",
|
|
33
|
-
"triangle",
|
|
34
|
-
"tee",
|
|
35
|
-
"other:x"
|
|
36
|
-
];
|
|
37
|
-
const ARROW_NAMES = /* @__PURE__ */ new Map([
|
|
38
|
-
["circle", "circle"],
|
|
39
|
-
["closed arrow", "triangle"],
|
|
40
|
-
["concave arrow", "vee"],
|
|
41
|
-
["diamond", "diamond"],
|
|
42
|
-
["open arrow", "triangle-open"],
|
|
43
|
-
["no arrow", "none"],
|
|
44
|
-
["pipe", "tee"],
|
|
45
|
-
["triangle", "triangle"],
|
|
46
|
-
["t", "tee"],
|
|
47
|
-
["x", "other:x"]
|
|
48
|
-
]);
|
|
49
|
-
function readAnnotations(snapshot) {
|
|
50
|
-
const { graph } = snapshot;
|
|
51
|
-
const cell = graph.has(CYTOSCAPE_ANNOTATIONS_COLUMN) ? graph.value(CYTOSCAPE_ANNOTATIONS_COLUMN, 0) : null;
|
|
52
|
-
const entries = cellStrings(cell);
|
|
53
|
-
const fields = entries.map(parseEntry);
|
|
54
|
-
const byId = new Map(fields.map((f, i) => [f.get("uuid") ?? String(i), f]));
|
|
55
|
-
const annotations = [];
|
|
56
|
-
const skipped = /* @__PURE__ */ new Set();
|
|
57
|
-
fields.forEach((f, i) => {
|
|
58
|
-
const read = readOne(f, String(i), byId);
|
|
59
|
-
if (read === null) {
|
|
60
|
-
skipped.add((f.get("type") ?? "").replace(TYPE_PREFIX, ""));
|
|
61
|
-
} else {
|
|
62
|
-
annotations.push(...read);
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
return { annotations, skipped: [...skipped] };
|
|
66
|
-
}
|
|
67
|
-
function cellStrings(cell) {
|
|
68
|
-
if (typeof cell === "string") {
|
|
69
|
-
return cell.split(/[\r\n]+/).filter((s) => s !== "");
|
|
70
|
-
}
|
|
71
|
-
if (cell !== null && typeof cell === "object" && Symbol.iterator in cell) {
|
|
72
|
-
return Array.from(cell).filter((s) => typeof s === "string" && s !== "");
|
|
73
|
-
}
|
|
74
|
-
return [];
|
|
75
|
-
}
|
|
76
|
-
function parseEntry(entry) {
|
|
77
|
-
const out = /* @__PURE__ */ new Map();
|
|
78
|
-
for (const part of entry.split("|")) {
|
|
79
|
-
const eq = part.indexOf("=");
|
|
80
|
-
if (eq > 0) {
|
|
81
|
-
out.set(part.slice(0, eq), part.slice(eq + 1));
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
return out;
|
|
85
|
-
}
|
|
86
|
-
function readOne(f, index, byId) {
|
|
87
|
-
const type = (f.get("type") ?? "").replace(TYPE_PREFIX, "");
|
|
88
|
-
const zoom = positive(f.get("zoom")) ?? 1;
|
|
89
|
-
const base = {
|
|
90
|
-
id: f.get("uuid") ?? index,
|
|
91
|
-
layer: f.get("canvas") === "background" ? "background" : "foreground",
|
|
92
|
-
z: num(f.get("z")) ?? 0
|
|
93
|
-
};
|
|
94
|
-
switch (type) {
|
|
95
|
-
case "ShapeAnnotation":
|
|
96
|
-
return [shapeOf(f, base, zoom)];
|
|
97
|
-
case "TextAnnotation":
|
|
98
|
-
return [textOf(f, base, zoom, { x: num(f.get("x")) ?? 0, y: -(num(f.get("y")) ?? 0) }, "top-left")];
|
|
99
|
-
case "BoundedTextAnnotation": {
|
|
100
|
-
const shape = shapeOf(f, base, zoom);
|
|
101
|
-
return [shape, textOf(f, { ...base, id: `${base.id}:text` }, zoom, shape.center, "center")];
|
|
102
|
-
}
|
|
103
|
-
case "ArrowAnnotation":
|
|
104
|
-
return arrowOf(f, base, zoom, byId);
|
|
105
|
-
default:
|
|
106
|
-
return null;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function shapeOf(f, base, zoom) {
|
|
110
|
-
const x = num(f.get("x")) ?? 0;
|
|
111
|
-
const y = num(f.get("y")) ?? 0;
|
|
112
|
-
const width = (positive(f.get("width")) ?? 0) / zoom;
|
|
113
|
-
const height = (positive(f.get("height")) ?? 0) / zoom;
|
|
114
|
-
const fill = javaColor(f.get("fillColor"));
|
|
115
|
-
const border = javaColor(f.get("edgeColor")) ?? { color: "#000000", alpha: 1 };
|
|
116
|
-
return {
|
|
117
|
-
...base,
|
|
118
|
-
kind: "shape",
|
|
119
|
-
center: { x: x + width / 2, y: -(y + height / 2) },
|
|
120
|
-
width,
|
|
121
|
-
height,
|
|
122
|
-
shape: SHAPES.get((f.get("shapeType") ?? "rectangle").toLowerCase()) ?? "rectangle",
|
|
123
|
-
fill: fill?.color ?? null,
|
|
124
|
-
fillOpacity: fill === null ? 0 : fill.alpha * percent(f.get("fillOpacity")),
|
|
125
|
-
borderColor: border.color,
|
|
126
|
-
borderOpacity: border.alpha * percent(f.get("edgeOpacity")),
|
|
127
|
-
borderWidth: (num(f.get("edgeThickness")) ?? 1) / zoom
|
|
128
|
-
};
|
|
129
|
-
}
|
|
130
|
-
function textOf(f, base, zoom, at, anchor) {
|
|
131
|
-
const style = num(f.get("fontStyle")) ?? 0;
|
|
132
|
-
const color = javaColor(f.get("color")) ?? { color: "#000000", alpha: 1 };
|
|
133
|
-
return {
|
|
134
|
-
...base,
|
|
135
|
-
kind: "text",
|
|
136
|
-
text: f.get("text") ?? "",
|
|
137
|
-
at,
|
|
138
|
-
anchor,
|
|
139
|
-
fontSize: (positive(f.get("fontSize")) ?? 12) / zoom,
|
|
140
|
-
fontFamily: f.get("fontFamily") ?? "sans-serif",
|
|
141
|
-
bold: (style & 1) !== 0,
|
|
142
|
-
italic: (style & 2) !== 0,
|
|
143
|
-
color: color.color,
|
|
144
|
-
opacity: color.alpha
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function arrowOf(f, base, zoom, byId) {
|
|
148
|
-
const target = f.get("targetAnnotation");
|
|
149
|
-
const to = point(f.get("targetPoint")) ?? point(f.get("targetNode")) ?? centerOf(byId.get(target ?? ""), zoom);
|
|
150
|
-
if (to === null) {
|
|
151
|
-
return null;
|
|
152
|
-
}
|
|
153
|
-
const corner = { x: num(f.get("x")) ?? 0, y: num(f.get("y")) ?? 0 };
|
|
154
|
-
const source = centerOf(byId.get(f.get("sourceAnnotation") ?? ""), zoom) ?? corner;
|
|
155
|
-
const from = { x: to.x > corner.x ? corner.x : source.x, y: to.y > corner.y ? corner.y : source.y };
|
|
156
|
-
const color = javaColor(f.get("lineColor")) ?? { color: "#000000", alpha: 1 };
|
|
157
|
-
return [
|
|
158
|
-
{
|
|
159
|
-
...base,
|
|
160
|
-
kind: "arrow",
|
|
161
|
-
from: { x: from.x, y: -from.y },
|
|
162
|
-
to: { x: to.x, y: -to.y },
|
|
163
|
-
color: color.color,
|
|
164
|
-
opacity: color.alpha * percent(f.get("lineOpacity")),
|
|
165
|
-
width: (positive(f.get("lineThickness")) ?? 1) / zoom,
|
|
166
|
-
sourceArrow: arrowShape(f.get("sourceType")),
|
|
167
|
-
targetArrow: arrowShape(f.get("targetType")),
|
|
168
|
-
sourceSize: positive(f.get("sourceSize")) ?? 1,
|
|
169
|
-
targetSize: positive(f.get("targetSize")) ?? 1
|
|
170
|
-
}
|
|
171
|
-
];
|
|
172
|
-
}
|
|
173
|
-
function centerOf(f, zoom) {
|
|
174
|
-
if (f === void 0) {
|
|
175
|
-
return null;
|
|
176
|
-
}
|
|
177
|
-
const x = num(f.get("x"));
|
|
178
|
-
const y = num(f.get("y"));
|
|
179
|
-
if (x === null || y === null) {
|
|
180
|
-
return null;
|
|
181
|
-
}
|
|
182
|
-
return { x: x + (positive(f.get("width")) ?? 0) / zoom / 2, y: y + (positive(f.get("height")) ?? 0) / zoom / 2 };
|
|
183
|
-
}
|
|
184
|
-
function arrowShape(raw) {
|
|
185
|
-
if (raw === void 0) {
|
|
186
|
-
return "none";
|
|
187
|
-
}
|
|
188
|
-
const n = num(raw);
|
|
189
|
-
if (n !== null) {
|
|
190
|
-
return ARROW_ORDER[n] ?? "triangle";
|
|
191
|
-
}
|
|
192
|
-
return ARROW_NAMES.get(raw.trim().toLowerCase()) ?? "triangle";
|
|
193
|
-
}
|
|
194
|
-
function point(raw) {
|
|
195
|
-
const [x, y] = (raw ?? "").split(",").map((s) => num(s));
|
|
196
|
-
return x === null || x === void 0 || y === null || y === void 0 ? null : { x, y };
|
|
197
|
-
}
|
|
198
|
-
function javaColor(raw) {
|
|
199
|
-
const n = num(raw);
|
|
200
|
-
if (n === null || !Number.isInteger(n)) {
|
|
201
|
-
return null;
|
|
202
|
-
}
|
|
203
|
-
const argb = n >>> 0;
|
|
204
|
-
return {
|
|
205
|
-
color: `#${(argb & 16777215).toString(16).padStart(6, "0")}`,
|
|
206
|
-
alpha: (argb >>> 24) / 255
|
|
207
|
-
};
|
|
208
|
-
}
|
|
209
|
-
function percent(raw) {
|
|
210
|
-
const n = num(raw);
|
|
211
|
-
return n === null ? 1 : Math.min(1, Math.max(0, n / 100));
|
|
212
|
-
}
|
|
213
|
-
function num(raw) {
|
|
214
|
-
if (raw === void 0 || raw.trim() === "") {
|
|
215
|
-
return null;
|
|
216
|
-
}
|
|
217
|
-
const n = Number(raw);
|
|
218
|
-
return Number.isFinite(n) ? n : null;
|
|
219
|
-
}
|
|
220
|
-
function positive(raw) {
|
|
221
|
-
const n = num(raw);
|
|
222
|
-
return n !== null && n > 0 ? n : null;
|
|
223
|
-
}
|
|
1
|
+
import { p as planStyles } from "./chunks/generic-ymWCETAJ.js";
|
|
2
|
+
import { M, e, r, a } from "./chunks/generic-ymWCETAJ.js";
|
|
3
|
+
import { h as StyleNotes, t as featuresOf, o as styleFingerprint } from "./chunks/block-iptrlMBb.js";
|
|
4
|
+
import { u, S, v, b, w, T, l, x, r as r2, y } from "./chunks/block-iptrlMBb.js";
|
|
5
|
+
import { S as StyleBudget, e as evaluateCytoscapeJs } from "./chunks/emit-BwHQkZle.js";
|
|
6
|
+
import { C, t } from "./chunks/emit-BwHQkZle.js";
|
|
224
7
|
const FUNCTION = () => null;
|
|
225
8
|
function withFunctions(style) {
|
|
226
9
|
if (!Array.isArray(style)) {
|
|
@@ -237,8 +20,8 @@ function withFunctions(style) {
|
|
|
237
20
|
}
|
|
238
21
|
const copy = /* @__PURE__ */ Object.create(null);
|
|
239
22
|
for (const name of Object.keys(props)) {
|
|
240
|
-
const
|
|
241
|
-
copy[name] =
|
|
23
|
+
const v2 = props[name];
|
|
24
|
+
copy[name] = v2 === "fn" ? FUNCTION : v2;
|
|
242
25
|
}
|
|
243
26
|
return { selector: e2.selector, style: copy };
|
|
244
27
|
});
|
|
@@ -268,7 +51,7 @@ function readCytoscapeStyles(input) {
|
|
|
268
51
|
}
|
|
269
52
|
}
|
|
270
53
|
}
|
|
271
|
-
const
|
|
54
|
+
const r3 = evaluateCytoscapeJs({
|
|
272
55
|
elements: input.elements,
|
|
273
56
|
style: withFunctions(input.style),
|
|
274
57
|
snapshot: input.snapshot,
|
|
@@ -285,8 +68,8 @@ function readCytoscapeStyles(input) {
|
|
|
285
68
|
dialect: "cytoscape-js",
|
|
286
69
|
tool: "cytoscape-js",
|
|
287
70
|
units: "px",
|
|
288
|
-
node: { values:
|
|
289
|
-
edge: { values:
|
|
71
|
+
node: { values: r3.node.values, rules: r3.node.rules, columns: r3.node.columns },
|
|
72
|
+
edge: { values: r3.edge.values, rules: r3.edge.rules, columns: r3.edge.columns },
|
|
290
73
|
fingerprint: styleFingerprint(s)
|
|
291
74
|
},
|
|
292
75
|
{ node: featuresOf(s, "node"), edge: featuresOf(s, "edge") },
|
|
@@ -295,28 +78,36 @@ function readCytoscapeStyles(input) {
|
|
|
295
78
|
notes,
|
|
296
79
|
budget,
|
|
297
80
|
signal: input.signal,
|
|
298
|
-
rawColumns: { node:
|
|
81
|
+
rawColumns: { node: r3.node.rawColumns, edge: r3.edge.rawColumns }
|
|
299
82
|
}
|
|
300
83
|
);
|
|
301
84
|
}
|
|
85
|
+
const BYPASS_NAMESPACES = /* @__PURE__ */ new Set(["cx.bypass", "cx2.bypass"]);
|
|
86
|
+
function isStyleSlotColumn(meta) {
|
|
87
|
+
const { origin } = meta;
|
|
88
|
+
return typeof origin?.namespace === "string" && BYPASS_NAMESPACES.has(origin.namespace) || meta.dtype === "json" && origin?.type === "graphics" && origin.namespace === "xgmml";
|
|
89
|
+
}
|
|
302
90
|
export {
|
|
303
|
-
|
|
304
|
-
|
|
91
|
+
C as CYTOSCAPE_IMPORT_KEY,
|
|
92
|
+
u as MAX_STYLE_BLOCK_LENGTH,
|
|
305
93
|
M as MAX_STYLE_RULES,
|
|
306
94
|
S as STYLE_BLOCK_NAME,
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
95
|
+
v as STYLE_ENUMS,
|
|
96
|
+
b as STYLE_ISSUE,
|
|
97
|
+
w as STYLE_PROPERTIES,
|
|
310
98
|
T as TOOL_DEFAULTS,
|
|
311
99
|
e as extractStyles,
|
|
312
100
|
featuresOf,
|
|
313
|
-
|
|
101
|
+
isStyleSlotColumn,
|
|
102
|
+
l as isStyleValue,
|
|
103
|
+
x as matchPredicate,
|
|
314
104
|
planStyles,
|
|
315
|
-
readAnnotations,
|
|
105
|
+
r as readAnnotations,
|
|
316
106
|
readCytoscapeStyles,
|
|
317
|
-
|
|
107
|
+
a as readImageAnnotations,
|
|
108
|
+
r2 as resolveStyles,
|
|
318
109
|
styleFingerprint,
|
|
319
110
|
t as toCytoscapeStylesheet,
|
|
320
|
-
|
|
111
|
+
y as toolDefaults
|
|
321
112
|
};
|
|
322
113
|
//# sourceMappingURL=styles.js.map
|
package/dist/styles.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styles.js","sources":["../src/styles/annotations.ts","../src/styles/cyjs/live.ts"],"sourcesContent":["/**\n * The annotations a file draws beside its graph: shapes, text notes and arrows that are not nodes or edges. Cytoscape\n * desktop keeps them in the network's `__Annotations` column (sessions, XGMML, CX and CX2 all carry it), one\n * `key=value|key=value` string per annotation; this reads them as neutral facts in the position convention (y up,\n * the file's own units), so they line up with `extractPositions()`.\n */\n\nimport type { GraphSnapshot } from \"@graphty/graph-format\";\n\nimport type { StyleArrowShape, StyleColor, StyleNodeShape } from \"./types.js\";\n\n/**\n * A point in the position convention: y up, in the file's own units.\n * @category Styles\n */\nexport interface AnnotationPoint {\n /** The x coordinate. */\n readonly x: number;\n /** The y coordinate, y up. */\n readonly y: number;\n}\n\n/**\n * What every annotation has.\n * @category Styles\n */\nexport interface AnnotationBase {\n /** The file's id for the annotation, or its index when the file gives none. */\n readonly id: string;\n /** Whether it is drawn behind the graph or in front of it. */\n readonly layer: \"background\" | \"foreground\";\n /** Its drawing order within its layer, lowest first. */\n readonly z: number;\n}\n\n/**\n * A filled, outlined shape.\n * @category Styles\n */\nexport interface ShapeAnnotation extends AnnotationBase {\n /** Which kind of annotation this is: always \"shape\". */\n readonly kind: \"shape\";\n /** The box's center. */\n readonly center: AnnotationPoint;\n /** The box's width. */\n readonly width: number;\n /** The box's height. */\n readonly height: number;\n /** The outline's shape. */\n readonly shape: StyleNodeShape;\n /** The fill color, or null for none. */\n readonly fill: StyleColor | null;\n /** The fill's opacity, 0..1. */\n readonly fillOpacity: number;\n /** The outline's color. */\n readonly borderColor: StyleColor;\n /** The outline's opacity, 0..1. */\n readonly borderOpacity: number;\n /** The outline's width. */\n readonly borderWidth: number;\n}\n\n/**\n * A line of text.\n * @category Styles\n */\nexport interface TextAnnotation extends AnnotationBase {\n /** Which kind of annotation this is: always \"text\". */\n readonly kind: \"text\";\n /** The text. */\n readonly text: string;\n /** Where the text is placed: the top-left corner of its box, or its center. */\n readonly at: AnnotationPoint;\n /** What `at` is. */\n readonly anchor: \"top-left\" | \"center\";\n /** The font size, in the file's units. */\n readonly fontSize: number;\n /** The font family. */\n readonly fontFamily: string;\n /** Whether the text is bold. */\n readonly bold: boolean;\n /** Whether the text is italic. */\n readonly italic: boolean;\n /** The text color. */\n readonly color: StyleColor;\n /** The text's opacity, 0..1. */\n readonly opacity: number;\n}\n\n/**\n * A line between two points, with an arrowhead at either end.\n * @category Styles\n */\nexport interface ArrowAnnotation extends AnnotationBase {\n /** Which kind of annotation this is: always \"arrow\". */\n readonly kind: \"arrow\";\n /** Where the line starts. */\n readonly from: AnnotationPoint;\n /** Where it ends. */\n readonly to: AnnotationPoint;\n /** The line color. */\n readonly color: StyleColor;\n /** The line's opacity, 0..1. */\n readonly opacity: number;\n /** The line width. */\n readonly width: number;\n /** The arrowhead at the start. */\n readonly sourceArrow: StyleArrowShape;\n /** The arrowhead at the end. */\n readonly targetArrow: StyleArrowShape;\n /** The start's arrowhead size as a factor of the normal size. */\n readonly sourceSize: number;\n /** The end's arrowhead size as a factor of the normal size. */\n readonly targetSize: number;\n}\n\n/**\n * One annotation.\n * @category Styles\n */\nexport type GraphAnnotation = ShapeAnnotation | TextAnnotation | ArrowAnnotation;\n\n/**\n * A file's annotations, and the kinds it holds that are not read (images, groups of annotations), by the file's\n * own type name, once each.\n * @category Styles\n */\nexport interface FileAnnotations {\n /** The annotations read, in the file's order. */\n readonly annotations: readonly GraphAnnotation[];\n /** The file's type names of the annotations not read. */\n readonly skipped: readonly string[];\n}\n\n/** The graph column Cytoscape desktop keeps its annotations in. */\nconst CYTOSCAPE_ANNOTATIONS_COLUMN = \"__Annotations\";\n\nconst TYPE_PREFIX = \"org.cytoscape.view.presentation.annotations.\";\n\n/** Cytoscape's annotation shape names, lowercase, as neutral shapes. */\nconst SHAPES: ReadonlyMap<string, StyleNodeShape> = new Map<string, StyleNodeShape>([\n [\"rectangle\", \"rectangle\"],\n [\"roundedrectangle\", \"round-rectangle\"],\n [\"rounded_rectangle\", \"round-rectangle\"],\n [\"ellipse\", \"ellipse\"],\n [\"triangle\", \"triangle\"],\n [\"diamond\", \"diamond\"],\n [\"pentagon\", \"pentagon\"],\n [\"hexagon\", \"hexagon\"],\n [\"octagon\", \"octagon\"],\n [\"parallelogram\", \"parallelogram\"],\n [\"star5\", \"star\"],\n [\"star6\", \"star\"],\n]);\n\n/**\n * Cytoscape's annotation arrowheads, by the position in its `ArrowType` list (older sessions) and by name (newer\n * ones), lowercase.\n */\nconst ARROW_ORDER: readonly StyleArrowShape[] = [\n \"circle\",\n \"triangle\",\n \"vee\",\n \"diamond\",\n \"triangle-open\",\n \"none\",\n \"tee\",\n \"triangle\",\n \"triangle\",\n \"triangle\",\n \"tee\",\n \"other:x\",\n];\nconst ARROW_NAMES: ReadonlyMap<string, StyleArrowShape> = new Map<string, StyleArrowShape>([\n [\"circle\", \"circle\"],\n [\"closed arrow\", \"triangle\"],\n [\"concave arrow\", \"vee\"],\n [\"diamond\", \"diamond\"],\n [\"open arrow\", \"triangle-open\"],\n [\"no arrow\", \"none\"],\n [\"pipe\", \"tee\"],\n [\"triangle\", \"triangle\"],\n [\"t\", \"tee\"],\n [\"x\", \"other:x\"],\n]);\n\n/**\n * The annotations a graph holds, from the column Cytoscape desktop keeps them in.\n * @param snapshot - the graph\n * @returns the annotations; none when the graph has the column empty or not at all\n * @category Styles\n */\nexport function readAnnotations(snapshot: GraphSnapshot): FileAnnotations {\n const { graph } = snapshot;\n const cell = graph.has(CYTOSCAPE_ANNOTATIONS_COLUMN) ? graph.value(CYTOSCAPE_ANNOTATIONS_COLUMN, 0) : null;\n const entries = cellStrings(cell);\n const fields = entries.map(parseEntry);\n const byId = new Map(fields.map((f, i) => [f.get(\"uuid\") ?? String(i), f]));\n const annotations: GraphAnnotation[] = [];\n const skipped = new Set<string>();\n fields.forEach((f, i) => {\n const read = readOne(f, String(i), byId);\n if (read === null) {\n skipped.add((f.get(\"type\") ?? \"\").replace(TYPE_PREFIX, \"\"));\n } else {\n annotations.push(...read);\n }\n });\n return { annotations, skipped: [...skipped] };\n}\n\n/**\n * A cell's strings: a list cell's items, or the lines of a text cell.\n * @param cell - the cell\n * @returns the strings\n */\nfunction cellStrings(cell: unknown): string[] {\n if (typeof cell === \"string\") {\n return cell.split(/[\\r\\n]+/).filter((s) => s !== \"\");\n }\n if (cell !== null && typeof cell === \"object\" && Symbol.iterator in cell) {\n return Array.from(cell as Iterable<unknown>).filter((s): s is string => typeof s === \"string\" && s !== \"\");\n }\n return [];\n}\n\n/**\n * One annotation string's fields.\n * @param entry - `key=value|key=value`\n * @returns the fields\n */\nfunction parseEntry(entry: string): Map<string, string> {\n const out = new Map<string, string>();\n for (const part of entry.split(\"|\")) {\n const eq = part.indexOf(\"=\");\n if (eq > 0) {\n out.set(part.slice(0, eq), part.slice(eq + 1));\n }\n }\n return out;\n}\n\n/**\n * One annotation as neutral facts; a bounded text annotation is a shape and its text.\n * @param f - its fields\n * @param index - its position, its id when it has no uuid\n * @param byId - every annotation's fields by id, for an arrow's ends\n * @returns the annotations, or null for a kind not read\n */\nfunction readOne(\n f: ReadonlyMap<string, string>,\n index: string,\n byId: ReadonlyMap<string, ReadonlyMap<string, string>>,\n): GraphAnnotation[] | null {\n const type = (f.get(\"type\") ?? \"\").replace(TYPE_PREFIX, \"\");\n const zoom = positive(f.get(\"zoom\")) ?? 1;\n const base: AnnotationBase = {\n id: f.get(\"uuid\") ?? index,\n layer: f.get(\"canvas\") === \"background\" ? \"background\" : \"foreground\",\n z: num(f.get(\"z\")) ?? 0,\n };\n switch (type) {\n case \"ShapeAnnotation\":\n return [shapeOf(f, base, zoom)];\n case \"TextAnnotation\":\n return [textOf(f, base, zoom, { x: num(f.get(\"x\")) ?? 0, y: -(num(f.get(\"y\")) ?? 0) }, \"top-left\")];\n case \"BoundedTextAnnotation\": {\n const shape = shapeOf(f, base, zoom);\n return [shape, textOf(f, { ...base, id: `${base.id}:text` }, zoom, shape.center, \"center\")];\n }\n case \"ArrowAnnotation\":\n return arrowOf(f, base, zoom, byId);\n default:\n return null;\n }\n}\n\n/**\n * A shape annotation: `x`, `y` its top-left corner, y down; `width`, `height` and the outline at the saved zoom.\n * @param f - its fields\n * @param base - its id, layer and order\n * @param zoom - the zoom its sizes were saved at\n * @returns the shape\n */\nfunction shapeOf(f: ReadonlyMap<string, string>, base: AnnotationBase, zoom: number): ShapeAnnotation {\n const x = num(f.get(\"x\")) ?? 0;\n const y = num(f.get(\"y\")) ?? 0;\n const width = (positive(f.get(\"width\")) ?? 0) / zoom;\n const height = (positive(f.get(\"height\")) ?? 0) / zoom;\n const fill = javaColor(f.get(\"fillColor\"));\n const border = javaColor(f.get(\"edgeColor\")) ?? { color: \"#000000\", alpha: 1 };\n return {\n ...base,\n kind: \"shape\",\n center: { x: x + width / 2, y: -(y + height / 2) },\n width,\n height,\n shape: SHAPES.get((f.get(\"shapeType\") ?? \"rectangle\").toLowerCase()) ?? \"rectangle\",\n fill: fill?.color ?? null,\n fillOpacity: fill === null ? 0 : fill.alpha * percent(f.get(\"fillOpacity\")),\n borderColor: border.color,\n borderOpacity: border.alpha * percent(f.get(\"edgeOpacity\")),\n borderWidth: (num(f.get(\"edgeThickness\")) ?? 1) / zoom,\n };\n}\n\n/**\n * A text annotation, or the text of a bounded one.\n * @param f - its fields\n * @param base - its id, layer and order\n * @param zoom - the zoom its font size was saved at\n * @param at - where it is placed\n * @param anchor - what `at` is\n * @returns the text\n */\nfunction textOf(\n f: ReadonlyMap<string, string>,\n base: AnnotationBase,\n zoom: number,\n at: AnnotationPoint,\n anchor: TextAnnotation[\"anchor\"],\n): TextAnnotation {\n // java.awt.Font styles: 1 bold, 2 italic, 3 both\n const style = num(f.get(\"fontStyle\")) ?? 0;\n const color = javaColor(f.get(\"color\")) ?? { color: \"#000000\", alpha: 1 };\n return {\n ...base,\n kind: \"text\",\n text: f.get(\"text\") ?? \"\",\n at,\n anchor,\n fontSize: (positive(f.get(\"fontSize\")) ?? 12) / zoom,\n fontFamily: f.get(\"fontFamily\") ?? \"sans-serif\",\n bold: (style & 1) !== 0,\n italic: (style & 2) !== 0,\n color: color.color,\n opacity: color.alpha,\n };\n}\n\n/**\n * An arrow annotation. Cytoscape keeps its start as the annotation it leaves (`sourceAnnotation`) and its end as a\n * point, a node's center at save time (`targetNode`) or another annotation, and saves the arrow's top-left corner\n * as `x`, `y`: the start wherever the end lies right of and below it, which is taken for the start, else the center\n * of the annotation it leaves.\n * @param f - its fields\n * @param base - its id, layer and order\n * @param zoom - the zoom its line width was saved at\n * @param byId - every annotation's fields by id\n * @returns the arrow, or null when it has no end\n */\nfunction arrowOf(\n f: ReadonlyMap<string, string>,\n base: AnnotationBase,\n zoom: number,\n byId: ReadonlyMap<string, ReadonlyMap<string, string>>,\n): ArrowAnnotation[] | null {\n const target = f.get(\"targetAnnotation\");\n const to = point(f.get(\"targetPoint\")) ?? point(f.get(\"targetNode\")) ?? centerOf(byId.get(target ?? \"\"), zoom);\n if (to === null) {\n return null;\n }\n const corner = { x: num(f.get(\"x\")) ?? 0, y: num(f.get(\"y\")) ?? 0 };\n const source = centerOf(byId.get(f.get(\"sourceAnnotation\") ?? \"\"), zoom) ?? corner;\n // ponytail: the start is exact only when the end lies right of and below it; elsewhere the center of the\n // annotation it leaves, as Cytoscape stores no other start. Clip to that annotation's box if it matters.\n const from = { x: to.x > corner.x ? corner.x : source.x, y: to.y > corner.y ? corner.y : source.y };\n const color = javaColor(f.get(\"lineColor\")) ?? { color: \"#000000\", alpha: 1 };\n return [\n {\n ...base,\n kind: \"arrow\",\n from: { x: from.x, y: -from.y },\n to: { x: to.x, y: -to.y },\n color: color.color,\n opacity: color.alpha * percent(f.get(\"lineOpacity\")),\n width: (positive(f.get(\"lineThickness\")) ?? 1) / zoom,\n sourceArrow: arrowShape(f.get(\"sourceType\")),\n targetArrow: arrowShape(f.get(\"targetType\")),\n sourceSize: positive(f.get(\"sourceSize\")) ?? 1,\n targetSize: positive(f.get(\"targetSize\")) ?? 1,\n },\n ];\n}\n\n/**\n * An annotation's center, y down as the file writes it: a shape's box center, a text's corner.\n * @param f - its fields, or undefined\n * @param zoom - the zoom the arrow was saved at\n * @returns the point, or null\n */\nfunction centerOf(f: ReadonlyMap<string, string> | undefined, zoom: number): AnnotationPoint | null {\n if (f === undefined) {\n return null;\n }\n const x = num(f.get(\"x\"));\n const y = num(f.get(\"y\"));\n if (x === null || y === null) {\n return null;\n }\n return { x: x + (positive(f.get(\"width\")) ?? 0) / zoom / 2, y: y + (positive(f.get(\"height\")) ?? 0) / zoom / 2 };\n}\n\n/**\n * An arrowhead by its `ArrowType` position or name.\n * @param raw - the field\n * @returns the shape; a triangle for one not known\n */\nfunction arrowShape(raw: string | undefined): StyleArrowShape {\n if (raw === undefined) {\n return \"none\";\n }\n const n = num(raw);\n if (n !== null) {\n return ARROW_ORDER[n] ?? \"triangle\";\n }\n return ARROW_NAMES.get(raw.trim().toLowerCase()) ?? \"triangle\";\n}\n\n/**\n * A `x,y` point as the file writes it.\n * @param raw - the field\n * @returns the point, or null\n */\nfunction point(raw: string | undefined): AnnotationPoint | null {\n const [x, y] = (raw ?? \"\").split(\",\").map((s) => num(s));\n return x === null || x === undefined || y === null || y === undefined ? null : { x, y };\n}\n\n/**\n * A Java color as a signed ARGB integer.\n * @param raw - the field\n * @returns the color and its alpha, or null\n */\nfunction javaColor(raw: string | undefined): { color: StyleColor; alpha: number } | null {\n const n = num(raw);\n if (n === null || !Number.isInteger(n)) {\n return null;\n }\n const argb = n >>> 0;\n return {\n color: `#${(argb & 0xffffff).toString(16).padStart(6, \"0\")}`,\n alpha: (argb >>> 24) / 255,\n };\n}\n\n/**\n * A 0..100 percentage as 0..1; 1 when absent.\n * @param raw - the field\n * @returns the fraction\n */\nfunction percent(raw: string | undefined): number {\n const n = num(raw);\n return n === null ? 1 : Math.min(1, Math.max(0, n / 100));\n}\n\n/**\n * A finite number.\n * @param raw - the field\n * @returns the number, or null\n */\nfunction num(raw: string | undefined): number | null {\n if (raw === undefined || raw.trim() === \"\") {\n return null;\n }\n const n = Number(raw);\n return Number.isFinite(n) ? n : null;\n}\n\n/**\n * A positive number.\n * @param raw - the field\n * @returns the number, or null\n */\nfunction positive(raw: string | undefined): number | null {\n const n = num(raw);\n return n !== null && n > 0 ? n : null;\n}\n","/**\n * The styles of a live Cytoscape.js core: the rules from its stylesheet (`cy.style().json()`) and, when given, the\n * truth per element from what the core reports it draws (`ele.style()`). Reported values win over the stylesheet\n * where they disagree, so a property whose stylesheet value is a function (which `cy.style().json()` writes as \"fn\")\n * is still exact: it is copied per element from the reported values and noted as `W_STYLE_LAYER_FLATTENED` with the\n * sample (and the rule reason) `FUNCTION`.\n */\n\nimport type { GraphSnapshot } from \"@graphty/graph-format\";\n\nimport { StyleBudget } from \"../budget.js\";\nimport { StyleNotes } from \"../notes.js\";\nimport { featuresOf, styleFingerprint } from \"../plan/features.js\";\nimport { planStyles } from \"../plan/plan.js\";\nimport type { ExtractedStyles, StyleWorkBudget } from \"../types.js\";\nimport { evaluateCytoscapeJs } from \"./cascade.js\";\n\n/** The input of `readCytoscapeStyles()`. */\nexport interface CytoscapeLiveInput {\n /** The core's elements: `cy.elements().jsons()`, or `{ nodes, edges }`. */\n readonly elements: unknown;\n /** The core's stylesheet: `cy.style().json()` (a function is written there as \"fn\"), or the one it was given. */\n readonly style: unknown;\n /**\n * What the core draws for each element, `ele.style()`, in the order of `elements` (for `{ nodes, edges }`, the\n * nodes then the edges); optional, and null for an element with none.\n */\n readonly rendered?: readonly (Readonly<Record<string, unknown>> | null | undefined)[];\n /** The graph the styles are for (the core's elements as a snapshot); the values come out indexed like it. */\n readonly snapshot: GraphSnapshot;\n /** The graph-io format id recorded as the styles' source; default \"json\". */\n readonly format?: string;\n /** Whether Cytoscape.js's defaults fill what the stylesheet leaves unset; default true. */\n readonly toolDefaults?: boolean;\n /**\n * Where problems are noted; graph-io's own engine passes its notes here.\n * @internal\n */\n readonly notes?: StyleNotes;\n /** The counted work budget. */\n readonly budget?: StyleWorkBudget;\n /** Cancels the work. */\n readonly signal?: AbortSignal;\n}\n\n/**\n * What a stylesheet function is read as: a function, whatever it returned.\n * @returns nothing\n */\nconst FUNCTION = (): null => null;\n\n/**\n * The stylesheet with every \"fn\" value (how `cy.style().json()` writes a function) read as a function.\n * @param style - the stylesheet\n * @returns the stylesheet to apply\n */\nfunction withFunctions(style: unknown): unknown {\n if (!Array.isArray(style)) {\n return style;\n }\n return style.map((entry: unknown) => {\n if (entry === null || typeof entry !== \"object\") {\n return entry;\n }\n const e = entry as Record<string, unknown>;\n const props = e.style ?? e.css;\n if (props === null || typeof props !== \"object\") {\n return entry;\n }\n const copy = Object.create(null) as Record<string, unknown>;\n for (const name of Object.keys(props)) {\n const v = (props as Record<string, unknown>)[name];\n copy[name] = v === \"fn\" ? FUNCTION : v;\n }\n return { selector: e.selector, style: copy };\n });\n}\n\n/**\n * The element list in order: an array as it is, `{ nodes, edges }` as the nodes then the edges.\n * @param elements - the elements\n * @returns the list\n */\nfunction elementList(elements: unknown): readonly unknown[] {\n if (Array.isArray(elements)) {\n return elements;\n }\n if (elements !== null && typeof elements === \"object\") {\n const e = elements as Record<string, unknown>;\n return [...(Array.isArray(e.nodes) ? e.nodes : []), ...(Array.isArray(e.edges) ? e.edges : [])];\n }\n return [];\n}\n\n/**\n * Reads the styles of a live Cytoscape.js core: the stylesheet's rules, with what the core reports it draws as the\n * truth per element when given.\n * @param input - the elements, the stylesheet, the reported values and the graph\n * @returns the styles, exact for every element\n * @category Styles\n */\nexport function readCytoscapeStyles(input: CytoscapeLiveInput): ExtractedStyles {\n const notes = input.notes ?? new StyleNotes();\n const budget = input.budget ?? new StyleBudget();\n let rendered: Map<object, Readonly<Record<string, unknown>>> | undefined;\n if (input.rendered !== undefined) {\n rendered = new Map();\n const list = elementList(input.elements);\n for (let i = 0; i < list.length && i < input.rendered.length; i++) {\n const json = list[i];\n const r = input.rendered[i];\n if (json !== null && typeof json === \"object\" && r !== null && r !== undefined && typeof r === \"object\") {\n rendered.set(json, r);\n }\n }\n }\n const r = evaluateCytoscapeJs({\n elements: input.elements,\n style: withFunctions(input.style),\n snapshot: input.snapshot,\n toolDefaults: input.toolDefaults,\n rendered,\n notes,\n budget,\n signal: input.signal,\n });\n const s = input.snapshot;\n return planStyles(\n {\n format: input.format ?? \"json\",\n dialect: \"cytoscape-js\",\n tool: \"cytoscape-js\",\n units: \"px\",\n node: { values: r.node.values, rules: r.node.rules, columns: r.node.columns },\n edge: { values: r.edge.values, rules: r.edge.rules, columns: r.edge.columns },\n fingerprint: styleFingerprint(s),\n },\n { node: featuresOf(s, \"node\"), edge: featuresOf(s, \"edge\") },\n {\n toolDefaults: input.toolDefaults,\n notes,\n budget,\n signal: input.signal,\n rawColumns: { node: r.node.rawColumns, edge: r.edge.rawColumns },\n },\n );\n}\n"],"names":["e","r"],"mappings":";;;;;;AAuIA,MAAM,+BAA+B;AAErC,MAAM,cAAc;AAGpB,MAAM,6BAAkD,IAA4B;AAAA,EAChF,CAAC,aAAa,WAAW;AAAA,EACzB,CAAC,oBAAoB,iBAAiB;AAAA,EACtC,CAAC,qBAAqB,iBAAiB;AAAA,EACvC,CAAC,WAAW,SAAS;AAAA,EACrB,CAAC,YAAY,UAAU;AAAA,EACvB,CAAC,WAAW,SAAS;AAAA,EACrB,CAAC,YAAY,UAAU;AAAA,EACvB,CAAC,WAAW,SAAS;AAAA,EACrB,CAAC,WAAW,SAAS;AAAA,EACrB,CAAC,iBAAiB,eAAe;AAAA,EACjC,CAAC,SAAS,MAAM;AAAA,EAChB,CAAC,SAAS,MAAM;AACpB,CAAC;AAMD,MAAM,cAA0C;AAAA,EAC5C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACJ;AACA,MAAM,kCAAwD,IAA6B;AAAA,EACvF,CAAC,UAAU,QAAQ;AAAA,EACnB,CAAC,gBAAgB,UAAU;AAAA,EAC3B,CAAC,iBAAiB,KAAK;AAAA,EACvB,CAAC,WAAW,SAAS;AAAA,EACrB,CAAC,cAAc,eAAe;AAAA,EAC9B,CAAC,YAAY,MAAM;AAAA,EACnB,CAAC,QAAQ,KAAK;AAAA,EACd,CAAC,YAAY,UAAU;AAAA,EACvB,CAAC,KAAK,KAAK;AAAA,EACX,CAAC,KAAK,SAAS;AACnB,CAAC;AAQM,SAAS,gBAAgB,UAA0C;AACtE,QAAM,EAAE,UAAU;AAClB,QAAM,OAAO,MAAM,IAAI,4BAA4B,IAAI,MAAM,MAAM,8BAA8B,CAAC,IAAI;AACtG,QAAM,UAAU,YAAY,IA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/styles/slots.ts"],"sourcesContent":["/**\n * The styles of a live Cytoscape.js core: the rules from its stylesheet (`cy.style().json()`) and, when given, the\n * truth per element from what the core reports it draws (`ele.style()`). Reported values win over the stylesheet\n * where they disagree, so a property whose stylesheet value is a function (which `cy.style().json()` writes as \"fn\")\n * is still exact: it is copied per element from the reported values and noted as `W_STYLE_LAYER_FLATTENED` with the\n * sample (and the rule reason) `FUNCTION`.\n */\n\nimport type { GraphSnapshot } from \"@graphty/graph-format\";\n\nimport { StyleBudget } from \"../budget.js\";\nimport { StyleNotes } from \"../notes.js\";\nimport { featuresOf, styleFingerprint } from \"../plan/features.js\";\nimport { planStyles } from \"../plan/plan.js\";\nimport type { ExtractedStyles, StyleWorkBudget } from \"../types.js\";\nimport { evaluateCytoscapeJs } from \"./cascade.js\";\n\n/** The input of `readCytoscapeStyles()`. */\nexport interface CytoscapeLiveInput {\n /** The core's elements: `cy.elements().jsons()`, or `{ nodes, edges }`. */\n readonly elements: unknown;\n /** The core's stylesheet: `cy.style().json()` (a function is written there as \"fn\"), or the one it was given. */\n readonly style: unknown;\n /**\n * What the core draws for each element, `ele.style()`, in the order of `elements` (for `{ nodes, edges }`, the\n * nodes then the edges); optional, and null for an element with none.\n */\n readonly rendered?: readonly (Readonly<Record<string, unknown>> | null | undefined)[];\n /** The graph the styles are for (the core's elements as a snapshot); the values come out indexed like it. */\n readonly snapshot: GraphSnapshot;\n /** The graph-io format id recorded as the styles' source; default \"json\". */\n readonly format?: string;\n /** Whether Cytoscape.js's defaults fill what the stylesheet leaves unset; default true. */\n readonly toolDefaults?: boolean;\n /**\n * Where problems are noted; graph-io's own engine passes its notes here.\n * @internal\n */\n readonly notes?: StyleNotes;\n /** The counted work budget. */\n readonly budget?: StyleWorkBudget;\n /** Cancels the work. */\n readonly signal?: AbortSignal;\n}\n\n/**\n * What a stylesheet function is read as: a function, whatever it returned.\n * @returns nothing\n */\nconst FUNCTION = (): null => null;\n\n/**\n * The stylesheet with every \"fn\" value (how `cy.style().json()` writes a function) read as a function.\n * @param style - the stylesheet\n * @returns the stylesheet to apply\n */\nfunction withFunctions(style: unknown): unknown {\n if (!Array.isArray(style)) {\n return style;\n }\n return style.map((entry: unknown) => {\n if (entry === null || typeof entry !== \"object\") {\n return entry;\n }\n const e = entry as Record<string, unknown>;\n const props = e.style ?? e.css;\n if (props === null || typeof props !== \"object\") {\n return entry;\n }\n const copy = Object.create(null) as Record<string, unknown>;\n for (const name of Object.keys(props)) {\n const v = (props as Record<string, unknown>)[name];\n copy[name] = v === \"fn\" ? FUNCTION : v;\n }\n return { selector: e.selector, style: copy };\n });\n}\n\n/**\n * The element list in order: an array as it is, `{ nodes, edges }` as the nodes then the edges.\n * @param elements - the elements\n * @returns the list\n */\nfunction elementList(elements: unknown): readonly unknown[] {\n if (Array.isArray(elements)) {\n return elements;\n }\n if (elements !== null && typeof elements === \"object\") {\n const e = elements as Record<string, unknown>;\n return [...(Array.isArray(e.nodes) ? e.nodes : []), ...(Array.isArray(e.edges) ? e.edges : [])];\n }\n return [];\n}\n\n/**\n * Reads the styles of a live Cytoscape.js core: the stylesheet's rules, with what the core reports it draws as the\n * truth per element when given.\n * @param input - the elements, the stylesheet, the reported values and the graph\n * @returns the styles, exact for every element\n * @category Styles\n */\nexport function readCytoscapeStyles(input: CytoscapeLiveInput): ExtractedStyles {\n const notes = input.notes ?? new StyleNotes();\n const budget = input.budget ?? new StyleBudget();\n let rendered: Map<object, Readonly<Record<string, unknown>>> | undefined;\n if (input.rendered !== undefined) {\n rendered = new Map();\n const list = elementList(input.elements);\n for (let i = 0; i < list.length && i < input.rendered.length; i++) {\n const json = list[i];\n const r = input.rendered[i];\n if (json !== null && typeof json === \"object\" && r !== null && r !== undefined && typeof r === \"object\") {\n rendered.set(json, r);\n }\n }\n }\n const r = evaluateCytoscapeJs({\n elements: input.elements,\n style: withFunctions(input.style),\n snapshot: input.snapshot,\n toolDefaults: input.toolDefaults,\n rendered,\n notes,\n budget,\n signal: input.signal,\n });\n const s = input.snapshot;\n return planStyles(\n {\n format: input.format ?? \"json\",\n dialect: \"cytoscape-js\",\n tool: \"cytoscape-js\",\n units: \"px\",\n node: { values: r.node.values, rules: r.node.rules, columns: r.node.columns },\n edge: { values: r.edge.values, rules: r.edge.rules, columns: r.edge.columns },\n fingerprint: styleFingerprint(s),\n },\n { node: featuresOf(s, \"node\"), edge: featuresOf(s, \"edge\") },\n {\n toolDefaults: input.toolDefaults,\n notes,\n budget,\n signal: input.signal,\n rawColumns: { node: r.node.rawColumns, edge: r.edge.rawColumns },\n },\n );\n}\n","/**\n * Which imported columns hold a format's own style slots rather than data.\n */\n\nimport type { ColumnMeta } from \"@graphty/graph-format\";\n\n// spelled out here rather than imported, so the styles entry loads no format module\n/** The origin namespaces of the columns the CX and CX2 importers read a file's bypasses into. */\nconst BYPASS_NAMESPACES: ReadonlySet<string> = new Set([\"cx.bypass\", \"cx2.bypass\"]);\n\n/**\n * Whether an imported column holds the file's own style slots rather than data: the bypasses of a CX or CX2 file,\n * and the `<graphics>` block of an XGMML element (or a Cytoscape session's). An application that draws the file's\n * styles from `extractStyles()` leaves these columns off its records, since the styles carry them.\n * @param meta - the column's metadata\n * @returns true for a style slot\n * @category Styles\n */\nexport function isStyleSlotColumn(meta: ColumnMeta): boolean {\n const { origin } = meta;\n return (\n (typeof origin?.namespace === \"string\" && BYPASS_NAMESPACES.has(origin.namespace)) ||\n (meta.dtype === \"json\" && origin?.type === \"graphics\" && origin.namespace === \"xgmml\")\n );\n}\n"],"names":["e","v","r"],"mappings":";;;;;;AAiDA,MAAM,WAAW,MAAY;AAO7B,SAAS,cAAc,OAAyB;AAC5C,MAAI,CAAC,MAAM,QAAQ,KAAK,GAAG;AACvB,WAAO;AAAA,EACX;AACA,SAAO,MAAM,IAAI,CAAC,UAAmB;AACjC,QAAI,UAAU,QAAQ,OAAO,UAAU,UAAU;AAC7C,aAAO;AAAA,IACX;AACA,UAAMA,KAAI;AACV,UAAM,QAAQA,GAAE,SAASA,GAAE;AAC3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AChC,UAAU,MAAM;AAAA,IAChB,cAAc,MAAM;AAAA,IACpB;AAAA,IACA;AAAA,IACA;AAAA,IACA,QAAQ,MAAM;AAAA,EAAA,CACjB;AACD,QAAM,IAAI,MAAM;AAChB,SAAO;AAAA,IACH;AAAA,MACI,QAAQ,MAAM,UAAU;AAAA,MACxB,SAAS;AAAA,MACT,MAAM;AAAA,MACN,OAAO;AAAA,MACP,MAAM,EAAE,QAAQA,GAAE,KAAK,QAAQ,OAAOA,GAAE,KAAK,OAAO,SAASA,GAAE,KAAK,QAAA;AAAA,MACpE,MAAM,EAAE,QAAQA,GAAE,KAAK,QAAQ,OAAOA,GAAE,KAAK,OAAO,SAASA,GAAE,KAAK,QAAA;AAAA,MACpE,aAAa,iBAAiB,CAAC;AAAA,IAAA;AAAA,IAEnC,EAAE,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,WAAW,GAAG,MAAM,EAAA;AAAA,IACzD;AAAA,MACI,cAAc,MAAM;AAAA,MACpB;AAAA,MACA;AAAA,MACA,QAAQ,MAAM;AAAA,MACd,YAAY,EAAE,MAAMA,GAAE,KAAK,YAAY,MAAMA,GAAE,KAAK,WAAA;AAAA,IAAW;AAAA,EACnE;AAER;AC1IA,MAAM,oBAAyC,oBAAI,IAAI,CAAC,aAAa,YAAY,CAAC;AAU3E,SAAS,kBAAkB,MAA2B;AACzD,QAAM,EAAE,WAAW;AACnB,SACK,OAAO,QAAQ,cAAc,YAAY,kBAAkB,IAAI,OAAO,SAAS,KAC/E,KAAK,UAAU,UAAU,QAAQ,SAAS,cAAc,OAAO,cAAc;AAEtF;"}
|
package/dist/xgmml.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { X, a } from "./chunks/styles-
|
|
2
|
-
import { x } from "./chunks/exporter-
|
|
3
|
-
import { x as x2 } from "./chunks/importer-
|
|
1
|
+
import { X, a } from "./chunks/styles-CCs214_3.js";
|
|
2
|
+
import { x } from "./chunks/exporter-D9yMtocA.js";
|
|
3
|
+
import { x as x2 } from "./chunks/importer-Vn5QvmmJ.js";
|
|
4
4
|
export {
|
|
5
5
|
X as XGMML_ISSUE,
|
|
6
6
|
a as XGMML_LOSS,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@graphty/graph-io",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.49",
|
|
4
4
|
"description": "Read and write 13 graph file formats (JSON, GraphML, GEXF, CSV, GML, DOT, Pajek, Neo4j CSV, XGMML, CX2, CX, OBO, Cytoscape sessions) as @graphty/graph-format snapshots",
|
|
5
5
|
"author": "Adam Powers <apowers@ato.ms>",
|
|
6
6
|
"type": "module",
|
|
@@ -77,6 +77,26 @@
|
|
|
77
77
|
"import": "./dist/cys.js",
|
|
78
78
|
"default": "./dist/cys.js"
|
|
79
79
|
},
|
|
80
|
+
"./sources/ndex": {
|
|
81
|
+
"types": "./dist/sources-ndex.d.ts",
|
|
82
|
+
"import": "./dist/sources-ndex.js",
|
|
83
|
+
"default": "./dist/sources-ndex.js"
|
|
84
|
+
},
|
|
85
|
+
"./sources/cypher": {
|
|
86
|
+
"types": "./dist/sources-cypher.d.ts",
|
|
87
|
+
"import": "./dist/sources-cypher.js",
|
|
88
|
+
"default": "./dist/sources-cypher.js"
|
|
89
|
+
},
|
|
90
|
+
"./sources/rest": {
|
|
91
|
+
"types": "./dist/sources-rest.d.ts",
|
|
92
|
+
"import": "./dist/sources-rest.js",
|
|
93
|
+
"default": "./dist/sources-rest.js"
|
|
94
|
+
},
|
|
95
|
+
"./sources/sparql": {
|
|
96
|
+
"types": "./dist/sources-sparql.d.ts",
|
|
97
|
+
"import": "./dist/sources-sparql.js",
|
|
98
|
+
"default": "./dist/sources-sparql.js"
|
|
99
|
+
},
|
|
80
100
|
"./styles": {
|
|
81
101
|
"types": "./dist/styles.d.ts",
|
|
82
102
|
"import": "./dist/styles.js",
|
|
@@ -131,41 +151,66 @@
|
|
|
131
151
|
},
|
|
132
152
|
"homepage": "https://graphty.app/docs/graph-io/",
|
|
133
153
|
"dependencies": {
|
|
134
|
-
"@graphty/graph-format": "^1.4.
|
|
154
|
+
"@graphty/graph-format": "^1.4.8"
|
|
135
155
|
},
|
|
136
156
|
"peerDependencies": {
|
|
137
|
-
"@graphty/graph-format": "^1.0.0"
|
|
157
|
+
"@graphty/graph-format": "^1.0.0",
|
|
158
|
+
"neo4j-driver": "^5.0.0"
|
|
159
|
+
},
|
|
160
|
+
"peerDependenciesMeta": {
|
|
161
|
+
"neo4j-driver": {
|
|
162
|
+
"optional": true
|
|
163
|
+
}
|
|
138
164
|
},
|
|
139
165
|
"devDependencies": {
|
|
166
|
+
"@resvg/resvg-js": "2.6.2",
|
|
167
|
+
"@sigma/export-image": "4.0.0",
|
|
168
|
+
"@storybook/addon-vitest": "^9.1.21",
|
|
169
|
+
"@storybook/web-components-vite": "^9.0.11",
|
|
170
|
+
"@vitest/browser-playwright": "4.1.11",
|
|
140
171
|
"@vitest/coverage-v8": "4.1.11",
|
|
141
172
|
"@vitest/ui": "4.1.11",
|
|
142
|
-
"cytoscape": "
|
|
173
|
+
"cytoscape": "3.34.3",
|
|
174
|
+
"esbuild": "0.25.10",
|
|
143
175
|
"eslint": "^9.29.0",
|
|
144
176
|
"fast-check": "^4.2.0",
|
|
145
177
|
"fast-xml-parser": "^5.11.1",
|
|
178
|
+
"graphology": "0.26.0",
|
|
179
|
+
"lit": "^3.3.1",
|
|
180
|
+
"neo4j-driver": "^5.28.3",
|
|
181
|
+
"playwright": "^1.53.0",
|
|
146
182
|
"prettier": "^3.4.2",
|
|
183
|
+
"sigma": "4.0.1",
|
|
184
|
+
"storybook": "^9.1.21",
|
|
185
|
+
"svgcanvas": "2.6.0",
|
|
147
186
|
"tsx": "^4.20.3",
|
|
148
187
|
"typedoc": "^0.28.15",
|
|
149
188
|
"typescript": "^5.9.3",
|
|
150
|
-
"
|
|
189
|
+
"vis-data": "7.1.9",
|
|
190
|
+
"vis-network": "9.1.9",
|
|
191
|
+
"vite": "^7.3.7",
|
|
151
192
|
"vitest": "4.1.11"
|
|
152
193
|
},
|
|
153
194
|
"scripts": {
|
|
154
195
|
"build": "node -e \"require('fs').rmSync('dist',{recursive:true,force:true})\" && tsc -p tsconfig.build.json",
|
|
155
196
|
"build:bundle": "node scripts/build-bundle.js",
|
|
156
197
|
"build:all": "npm run build && npm run build:bundle",
|
|
157
|
-
"lint": "eslint && tsc --noEmit -p tsconfig.json",
|
|
198
|
+
"lint": "eslint && tsc --noEmit -p tsconfig.json && tsc --noEmit -p fidelity-stories/tsconfig.json",
|
|
158
199
|
"lint:fix": "eslint --fix",
|
|
159
|
-
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
200
|
+
"typecheck": "tsc --noEmit -p tsconfig.json && tsc --noEmit -p fidelity-stories/tsconfig.json",
|
|
160
201
|
"typecheck:strict-consumer": "tsc -p tsconfig.strict-consumer.json",
|
|
161
202
|
"test": "vitest",
|
|
162
203
|
"test:ui": "vitest --ui",
|
|
163
204
|
"test:run": "vitest run",
|
|
205
|
+
"test:storybook": "vitest run --config vitest.storybook.config.ts",
|
|
164
206
|
"coverage": "vitest run --coverage",
|
|
165
207
|
"coverage:preview": "npx serve coverage -p ${PORT:?start it through servherd, which sets PORT}",
|
|
166
208
|
"benchmark": "tsx benchmarks/run.ts",
|
|
167
209
|
"docs:reference": "tsx scripts/docs-reference.ts",
|
|
168
210
|
"docs:api": "tsx scripts/docs-reference.ts --check && typedoc && node ../tools/sanitize-api-docs.js docs/api/generated",
|
|
169
|
-
"ready:commit": "npm run build:all && npm run lint && npm run typecheck:strict-consumer && npm run test:run"
|
|
211
|
+
"ready:commit": "npm run build:all && npm run lint && npm run typecheck:strict-consumer && npm run test:run",
|
|
212
|
+
"test:browser": "vitest run --config vitest.browser.config.ts",
|
|
213
|
+
"storybook": "storybook dev -c fidelity-stories/.storybook -p ${PORT:?start it through servherd, which sets PORT} --host ${HOST:-localhost} ${HTTPS_CERT_PATH:+--https --ssl-cert $HTTPS_CERT_PATH --ssl-key $HTTPS_KEY_PATH} --no-open",
|
|
214
|
+
"build-storybook": "git lfs pull --include \"graph-io/test/fidelity/oracles/*.png\" && storybook build -c fidelity-stories/.storybook -o fidelity-stories/storybook-static"
|
|
170
215
|
}
|
|
171
216
|
}
|
package/src/common/report.ts
CHANGED
|
@@ -198,10 +198,17 @@ export class ImportReportBuilder {
|
|
|
198
198
|
* @param code - a stable code such as "E_UNKNOWN_NODE"
|
|
199
199
|
* @param message - a plain-ASCII message
|
|
200
200
|
* @param where - the line and element, when known
|
|
201
|
+
* @param params - the issue's machine-readable values (`{ status: 401 }`), when it has any
|
|
201
202
|
* @returns the recorded issue
|
|
202
203
|
*/
|
|
203
|
-
error(
|
|
204
|
-
|
|
204
|
+
error(
|
|
205
|
+
category: IssueCategory,
|
|
206
|
+
code: string,
|
|
207
|
+
message: string,
|
|
208
|
+
where?: IssueLocation,
|
|
209
|
+
params?: Readonly<Record<string, unknown>>,
|
|
210
|
+
): ImportIssue {
|
|
211
|
+
const issue = makeIssue(category, "error", code, message, where, params);
|
|
205
212
|
this.issueList.push(issue);
|
|
206
213
|
this.errors++;
|
|
207
214
|
if (this.errors > this.errorLimit) {
|
|
@@ -222,10 +229,17 @@ export class ImportReportBuilder {
|
|
|
222
229
|
* @param code - a stable code such as "W_WIDENED"
|
|
223
230
|
* @param message - a plain-ASCII message
|
|
224
231
|
* @param where - the line and element, when known
|
|
232
|
+
* @param params - the issue's machine-readable values, when it has any
|
|
225
233
|
* @returns the recorded issue
|
|
226
234
|
*/
|
|
227
|
-
warning(
|
|
228
|
-
|
|
235
|
+
warning(
|
|
236
|
+
category: IssueCategory,
|
|
237
|
+
code: string,
|
|
238
|
+
message: string,
|
|
239
|
+
where?: IssueLocation,
|
|
240
|
+
params?: Readonly<Record<string, unknown>>,
|
|
241
|
+
): ImportIssue {
|
|
242
|
+
const issue = makeIssue(category, "warning", code, message, where, params);
|
|
229
243
|
const seen = (this.warningsByCode.get(code) ?? 0) + 1;
|
|
230
244
|
this.warningsByCode.set(code, seen);
|
|
231
245
|
if (seen <= MAX_WARNINGS_PER_CODE) {
|
|
@@ -365,6 +379,7 @@ export class ImportReportBuilder {
|
|
|
365
379
|
* @param message - a plain-ASCII message
|
|
366
380
|
* @param where - the line and element, when known
|
|
367
381
|
* @param details - optional machine-readable context for the ImportError
|
|
382
|
+
* @param params - the issue's machine-readable values, when it has any
|
|
368
383
|
*/
|
|
369
384
|
failWith(
|
|
370
385
|
category: IssueCategory,
|
|
@@ -372,8 +387,9 @@ export class ImportReportBuilder {
|
|
|
372
387
|
message: string,
|
|
373
388
|
where?: IssueLocation,
|
|
374
389
|
details?: Readonly<Record<string, unknown>>,
|
|
390
|
+
params?: Readonly<Record<string, unknown>>,
|
|
375
391
|
): never {
|
|
376
|
-
this.issueList.push(makeIssue(category, "error", code, message, where));
|
|
392
|
+
this.issueList.push(makeIssue(category, "error", code, message, where, params));
|
|
377
393
|
this.errors++;
|
|
378
394
|
throw this.abort(withLine(message, where), { code, ...details });
|
|
379
395
|
}
|
|
@@ -463,6 +479,7 @@ export class ImportReportBuilder {
|
|
|
463
479
|
* @param code - the stable code
|
|
464
480
|
* @param message - the message
|
|
465
481
|
* @param where - the location, when known
|
|
482
|
+
* @param params - the issue's values, when it has any
|
|
466
483
|
* @returns the issue
|
|
467
484
|
*/
|
|
468
485
|
function makeIssue(
|
|
@@ -471,15 +488,18 @@ function makeIssue(
|
|
|
471
488
|
code: string,
|
|
472
489
|
message: string,
|
|
473
490
|
where: IssueLocation | undefined,
|
|
491
|
+
params?: Readonly<Record<string, unknown>>,
|
|
474
492
|
): ImportIssue {
|
|
475
|
-
|
|
493
|
+
const issue = {
|
|
476
494
|
category,
|
|
477
495
|
severity,
|
|
478
496
|
code,
|
|
479
497
|
message,
|
|
480
498
|
line: where?.line ?? null,
|
|
481
499
|
element: where?.element ?? null,
|
|
482
|
-
}
|
|
500
|
+
};
|
|
501
|
+
// the key only when there are values, so the issues of every format keep their shape
|
|
502
|
+
return Object.freeze(params === undefined ? issue : { ...issue, params: Object.freeze({ ...params }) });
|
|
483
503
|
}
|
|
484
504
|
|
|
485
505
|
/**
|
|
@@ -2936,7 +2936,12 @@ class CxReader {
|
|
|
2936
2936
|
}
|
|
2937
2937
|
return true;
|
|
2938
2938
|
});
|
|
2939
|
-
const
|
|
2939
|
+
const { weightFrom } = this.options;
|
|
2940
|
+
const collection = aspect(this.doc, "cySubNetworks").length > 0;
|
|
2941
|
+
const source: CxStyleSource =
|
|
2942
|
+
others.size > 0
|
|
2943
|
+
? { entries: kept, otherViews: others.size, weightFrom, collection }
|
|
2944
|
+
: { entries: kept, weightFrom, collection };
|
|
2940
2945
|
this.report.keepForStyles(source);
|
|
2941
2946
|
}
|
|
2942
2947
|
|