@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
|
@@ -1,1067 +1,15 @@
|
|
|
1
1
|
import { GraphFormatError, INVALID_INDEX } from "@graphty/graph-format";
|
|
2
2
|
import { c as childrenCsr } from "./children-CA4coBi0.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
3
|
+
import { p as pairFolding, f as formatF32, a as formatF64, i as idText, d as formatDecimal, c as formatInteger, D as DirectionResolver } from "./format-BXiAb-1h.js";
|
|
4
|
+
import { q as quoteDotId, f as isWritableDotText } from "./escape-CuCIzNMB.js";
|
|
5
|
+
import { L as LOSS, c as capabilities, r as resolveExportOptions, a as checkCapabilities, G as countMixedEdges, e as explicitWeights, z as sanitizeIds, H as canonicalId, b as resolveImportOptions, d as reportUnusedOptions, f as reportSinkOptions, h as graphChosen, I as IdCoercer, p as parseWeightText, i as declareResolved } from "./export-Cha4dRFz.js";
|
|
6
|
+
import { p as plural, a as agree, M as MIXED_DIRECTION_CODE, D as DIRECTION_FORCED_CODE, b as DIRECTION_REFUSED_CODE, S as SINK_OPTION_CODE, I as ID_MERGED_CODE, O as OPTION_IGNORED_CODE, C as COLUMN_RENAMED_CODE, R as ROLE_TAKEN_CODE, l as DUPLICATE_ATTRIBUTE_CODE, P as PRECISION_CODE, W as AMBIGUOUS_GRAPH_NAME_CODE, Y as GRAPH_NOT_FOUND_CODE, i as MULTIPLE_GRAPHS_CODE, r as ENCODING_CONFLICT_CODE, s as UNKNOWN_ENCODING_CODE, t as ENCODING_FALLBACK_CODE, u as INVALID_ENCODING_CODE, v as INVALID_UTF8_CODE, E as EMPTY_INPUT_CODE, Q as SYNTAX_CODE, y as ELEMENT_ISSUE, z as INPUT_ISSUE, K as ImportReportBuilder } from "./report-CwMfYa9J.js";
|
|
7
|
+
import { i as inferTextDtype, W as WIDENING_UNSUPPORTED_CODE, p as parseTextCell, T as TextCellWriter } from "./text-ystE2bYi.js";
|
|
7
8
|
import { j as joinText, e as encodeChunks, i as indentUnit } from "./writer-DxjgHwSe.js";
|
|
8
|
-
import { i as
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import { s as sharedInExportCall } from "./writer-DMKvthQE.js";
|
|
13
|
-
import { v as valueColumns } from "./styles-yed-BF5x3_Y5.js";
|
|
14
|
-
const DOT_FORMAT = "dot";
|
|
15
|
-
const DOT_ORIGIN = Object.freeze({ format: DOT_FORMAT });
|
|
16
|
-
const CLUSTER_COLUMN = "graphty.cluster";
|
|
17
|
-
const PARENT_COLUMN = "graphty.parent";
|
|
18
|
-
const SOURCE_PORT_COLUMN = "graphty.sourcePort";
|
|
19
|
-
const TARGET_PORT_COLUMN = "graphty.targetPort";
|
|
20
|
-
const LABEL_ATTRIBUTE = "label";
|
|
21
|
-
const POS_ATTRIBUTE = "pos";
|
|
22
|
-
const POSITION_COLUMN = "graphty.position";
|
|
23
|
-
const KEY_ATTRIBUTE = "key";
|
|
24
|
-
const PIN_ATTRIBUTE = "pin";
|
|
25
|
-
const DOT_META_KEY = "dot";
|
|
26
|
-
const DOT_STYLE_CAPABILITIES = Object.freeze({
|
|
27
|
-
node: Object.freeze([
|
|
28
|
-
"fill",
|
|
29
|
-
"fillOpacity",
|
|
30
|
-
"borderColor",
|
|
31
|
-
"borderWidth",
|
|
32
|
-
"borderStyle",
|
|
33
|
-
"shape",
|
|
34
|
-
"width",
|
|
35
|
-
"height",
|
|
36
|
-
"label",
|
|
37
|
-
"labelColor",
|
|
38
|
-
"labelSize",
|
|
39
|
-
"labelFont",
|
|
40
|
-
"tooltip",
|
|
41
|
-
"visible"
|
|
42
|
-
]),
|
|
43
|
-
edge: Object.freeze([
|
|
44
|
-
"color",
|
|
45
|
-
"opacity",
|
|
46
|
-
"width",
|
|
47
|
-
"lineStyle",
|
|
48
|
-
"sourceArrow",
|
|
49
|
-
"targetArrow",
|
|
50
|
-
"arrowSize",
|
|
51
|
-
"label",
|
|
52
|
-
"sourceLabel",
|
|
53
|
-
"targetLabel",
|
|
54
|
-
"labelColor",
|
|
55
|
-
"labelSize",
|
|
56
|
-
"labelFont",
|
|
57
|
-
"tooltip",
|
|
58
|
-
"visible"
|
|
59
|
-
]),
|
|
60
|
-
graph: Object.freeze(["background"]),
|
|
61
|
-
block: "native"
|
|
62
|
-
});
|
|
63
|
-
const NAME_KEY = "name";
|
|
64
|
-
const DIRECTED_KEY = "directed";
|
|
65
|
-
const CLUSTER_KEY = "cluster";
|
|
66
|
-
const NODE_ATTRIBUTES = [
|
|
67
|
-
"colorscheme",
|
|
68
|
-
"color",
|
|
69
|
-
"fillcolor",
|
|
70
|
-
"bgcolor",
|
|
71
|
-
"pencolor",
|
|
72
|
-
"style",
|
|
73
|
-
"shape",
|
|
74
|
-
"width",
|
|
75
|
-
"height",
|
|
76
|
-
"fixedsize",
|
|
77
|
-
"regular",
|
|
78
|
-
"penwidth",
|
|
79
|
-
"fontname",
|
|
80
|
-
"fontsize",
|
|
81
|
-
"fontcolor",
|
|
82
|
-
"tooltip"
|
|
83
|
-
];
|
|
84
|
-
const EDGE_ATTRIBUTES = [
|
|
85
|
-
"colorscheme",
|
|
86
|
-
"color",
|
|
87
|
-
"style",
|
|
88
|
-
"penwidth",
|
|
89
|
-
"fontname",
|
|
90
|
-
"fontsize",
|
|
91
|
-
"fontcolor",
|
|
92
|
-
"tooltip",
|
|
93
|
-
"edgetooltip",
|
|
94
|
-
"arrowhead",
|
|
95
|
-
"arrowtail",
|
|
96
|
-
"dir",
|
|
97
|
-
"arrowsize",
|
|
98
|
-
"headlabel",
|
|
99
|
-
"taillabel"
|
|
100
|
-
];
|
|
101
|
-
const NOTED_ATTRIBUTES = ["peripheries", "xlabel"];
|
|
102
|
-
const CIRCLE_LIKE = /* @__PURE__ */ new Set(["circle", "doublecircle", "mcircle", "square", "msquare"]);
|
|
103
|
-
const BOX_LIKE = /* @__PURE__ */ new Set(["box", "rect", "rectangle", "square"]);
|
|
104
|
-
const ELLIPSE_LIKE = /* @__PURE__ */ new Set(["", "ellipse", "oval", "circle"]);
|
|
105
|
-
const NO_OUTLINE = /* @__PURE__ */ new Set(["plain", "plaintext", "none"]);
|
|
106
|
-
const RECORD = /* @__PURE__ */ new Set(["record", "mrecord"]);
|
|
107
|
-
const TRUE_TEXTS$1 = /* @__PURE__ */ new Set(["true", "yes", "shape"]);
|
|
108
|
-
const POINT_SIZE = 0.05;
|
|
109
|
-
const REGULAR_SIZE = 0.5;
|
|
110
|
-
function isHtmlString(text) {
|
|
111
|
-
if (text.length < 2 || !text.startsWith("<") || !text.endsWith(">")) {
|
|
112
|
-
return false;
|
|
113
|
-
}
|
|
114
|
-
let depth = 0;
|
|
115
|
-
for (let i = 0; i < text.length; i++) {
|
|
116
|
-
const c = text.codePointAt(i);
|
|
117
|
-
if (c === 60) {
|
|
118
|
-
depth++;
|
|
119
|
-
} else if (c === 62) {
|
|
120
|
-
depth--;
|
|
121
|
-
if (depth === 0 && i !== text.length - 1) {
|
|
122
|
-
return false;
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
return depth === 0;
|
|
127
|
-
}
|
|
128
|
-
function cellText$1(table, name, i) {
|
|
129
|
-
if (!table.has(name)) {
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
const v = plainCell(table.value(name, i));
|
|
133
|
-
if (typeof v === "string") {
|
|
134
|
-
return v;
|
|
135
|
-
}
|
|
136
|
-
return typeof v === "number" || typeof v === "boolean" ? String(v) : null;
|
|
137
|
-
}
|
|
138
|
-
function nonEmpty(v) {
|
|
139
|
-
return v === null || v === "" ? null : v;
|
|
140
|
-
}
|
|
141
|
-
function styleTokens(raw, at) {
|
|
142
|
-
if (raw === null) {
|
|
143
|
-
return [];
|
|
144
|
-
}
|
|
145
|
-
if (raw.length > MAX_STYLE_VALUE_LENGTH) {
|
|
146
|
-
noteAt(at, STYLE_ISSUE.VALUE_TOO_LONG, `${String(raw.length)} characters`);
|
|
147
|
-
return [];
|
|
148
|
-
}
|
|
149
|
-
return raw.toLowerCase().split(",").map((t) => t.replace(/^[ \t\r\n]+/, "")).filter((t) => t !== "");
|
|
150
|
-
}
|
|
151
|
-
function setLineWidth(tokens) {
|
|
152
|
-
for (const t of tokens) {
|
|
153
|
-
if (t.startsWith("setlinewidth(") && t.endsWith(")")) {
|
|
154
|
-
return t.slice("setlinewidth(".length, -1).trim();
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
return null;
|
|
158
|
-
}
|
|
159
|
-
function isTrue(raw) {
|
|
160
|
-
if (raw === null) {
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
const t = raw.trim().toLowerCase();
|
|
164
|
-
return TRUE_TEXTS$1.has(t) || /^-?\d+$/.test(t) && Number(t) !== 0;
|
|
165
|
-
}
|
|
166
|
-
function labelText(raw, names, html, record, at) {
|
|
167
|
-
if (isHtmlString(raw)) {
|
|
168
|
-
return htmlLabelText(raw, at);
|
|
169
|
-
}
|
|
170
|
-
if (html.has(`<${raw}>`)) {
|
|
171
|
-
return htmlLabelText(`<${raw}>`, at);
|
|
172
|
-
}
|
|
173
|
-
return dotLabelText(record ? recordLabelText(raw, at) : raw, names, at);
|
|
174
|
-
}
|
|
175
|
-
function readColor(raw, scheme, use, property, opacity, put, at) {
|
|
176
|
-
if (raw === null) {
|
|
177
|
-
return null;
|
|
178
|
-
}
|
|
179
|
-
const c = canonColor(raw, "graphviz", at(property), { scheme, use });
|
|
180
|
-
if (c === null) {
|
|
181
|
-
return null;
|
|
182
|
-
}
|
|
183
|
-
put(property, c.color);
|
|
184
|
-
if (opacity !== null) {
|
|
185
|
-
put(opacity, c.alpha);
|
|
186
|
-
} else if (c.alpha > 0 || property !== "borderColor") {
|
|
187
|
-
colorOpacity(c, null, at(property), false);
|
|
188
|
-
}
|
|
189
|
-
return c.alpha;
|
|
190
|
-
}
|
|
191
|
-
function inchesOf(points) {
|
|
192
|
-
const want = num6(points);
|
|
193
|
-
for (let digits = 6; digits < 17; digits++) {
|
|
194
|
-
const inches2 = Number((points / DOT_POINTS_PER_INCH).toPrecision(digits));
|
|
195
|
-
if (num6(inches2 * DOT_POINTS_PER_INCH) === want) {
|
|
196
|
-
return inches2 + 0;
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
return points / DOT_POINTS_PER_INCH;
|
|
200
|
-
}
|
|
201
|
-
function inches(raw, at) {
|
|
202
|
-
if (raw === null) {
|
|
203
|
-
return null;
|
|
204
|
-
}
|
|
205
|
-
const v = raw.trim() === "" ? Number.NaN : Number(raw);
|
|
206
|
-
if (!Number.isFinite(v) || v < 0) {
|
|
207
|
-
noteAt(at, STYLE_ISSUE.BAD_VALUE, raw.slice(0, MAX_STYLE_VALUE_LENGTH));
|
|
208
|
-
return null;
|
|
209
|
-
}
|
|
210
|
-
return v;
|
|
211
|
-
}
|
|
212
|
-
function readCommon(get, tokens, scheme, names, put, at) {
|
|
213
|
-
if (tokens.includes("invis")) {
|
|
214
|
-
put("visible", false);
|
|
215
|
-
}
|
|
216
|
-
readColor(nonEmpty(get("fontcolor")), scheme, "line", "labelColor", null, put, at);
|
|
217
|
-
const size = get("fontsize");
|
|
218
|
-
put("labelSize", size === null ? null : canonNumber(size, at("labelSize")));
|
|
219
|
-
const font = get("fontname");
|
|
220
|
-
if (font !== null && font.length <= MAX_STYLE_VALUE_LENGTH) {
|
|
221
|
-
put("labelFont", font);
|
|
222
|
-
}
|
|
223
|
-
const tip = get("tooltip") ?? get("edgetooltip");
|
|
224
|
-
if (tip !== null) {
|
|
225
|
-
put("tooltip", dotLabelText(tip, names, at("tooltip")));
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
function readNode(get, cx, put, at) {
|
|
229
|
-
const tokens = styleTokens(get("style"), at("visible"));
|
|
230
|
-
const shapeRaw = nonEmpty(get("shape"));
|
|
231
|
-
const shape = (shapeRaw ?? "").toLowerCase();
|
|
232
|
-
const n = {
|
|
233
|
-
get,
|
|
234
|
-
cx,
|
|
235
|
-
put,
|
|
236
|
-
at,
|
|
237
|
-
tokens,
|
|
238
|
-
shapeRaw,
|
|
239
|
-
shape,
|
|
240
|
-
point: !cx.cluster && shape === "point",
|
|
241
|
-
scheme: get("colorscheme"),
|
|
242
|
-
color: nonEmpty(get("color"))
|
|
243
|
-
};
|
|
244
|
-
const names = cx.cluster ? { graph: cx.name } : { node: cx.name, graph: cx.graph, edge: "" };
|
|
245
|
-
readCommon(get, tokens, n.scheme, names, put, at);
|
|
246
|
-
if (cx.cluster) {
|
|
247
|
-
readClusterFill(n);
|
|
248
|
-
} else {
|
|
249
|
-
readNodeFill(n);
|
|
250
|
-
}
|
|
251
|
-
readNodeOutline(n);
|
|
252
|
-
readNodeShape(n);
|
|
253
|
-
const label = n.point ? null : get(LABEL_ATTRIBUTE);
|
|
254
|
-
if (label !== null) {
|
|
255
|
-
put("label", labelText(label, names, cx.html, RECORD.has(shape), at("label")));
|
|
256
|
-
}
|
|
257
|
-
if (!cx.cluster) {
|
|
258
|
-
readSize(get, shape, n.point, label ?? (n.point ? null : cx.name), put, at);
|
|
259
|
-
}
|
|
260
|
-
if (Number(get("peripheries")) > 1 || nonEmpty(get("xlabel")) !== null) {
|
|
261
|
-
noteAt(at("label"), STYLE_ISSUE.NOT_CARRIED, nonEmpty(get("xlabel")) === null ? "peripheries" : "xlabel");
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
function readClusterFill(n) {
|
|
265
|
-
const { get, tokens } = n;
|
|
266
|
-
const filled = tokens.includes("filled") || tokens.includes("radial") || tokens.includes("striped");
|
|
267
|
-
const bg = nonEmpty(get("bgcolor"));
|
|
268
|
-
const raw = filled ? nonEmpty(get("fillcolor")) ?? n.color ?? bg ?? "lightgrey" : bg;
|
|
269
|
-
readColor(raw, n.scheme, "fill", "fill", "fillOpacity", n.put, n.at);
|
|
270
|
-
}
|
|
271
|
-
function readNodeFill(n) {
|
|
272
|
-
const { shape, point } = n;
|
|
273
|
-
const fillcolor = nonEmpty(n.get("fillcolor"));
|
|
274
|
-
const filled = point || n.tokens.some(
|
|
275
|
-
(t) => t === "filled" || t === "radial" || t === "striped" && BOX_LIKE.has(shape) || t === "wedged" && ELLIPSE_LIKE.has(shape)
|
|
276
|
-
);
|
|
277
|
-
if (filled) {
|
|
278
|
-
const raw = fillcolor ?? n.color ?? (point ? "black" : "lightgrey");
|
|
279
|
-
readColor(raw, n.scheme, "fill", "fill", "fillOpacity", n.put, n.at);
|
|
280
|
-
} else if (fillcolor !== null) {
|
|
281
|
-
noteAt(n.at("fill"), STYLE_ISSUE.UNFILLED, fillcolor.slice(0, MAX_STYLE_VALUE_LENGTH));
|
|
282
|
-
}
|
|
283
|
-
}
|
|
284
|
-
function readNodeOutline(n) {
|
|
285
|
-
const { get, cx, put, at, tokens } = n;
|
|
286
|
-
if (!cx.cluster && NO_OUTLINE.has(n.shape)) {
|
|
287
|
-
put("borderWidth", 0);
|
|
288
|
-
} else {
|
|
289
|
-
const outline = cx.cluster ? nonEmpty(get("pencolor")) ?? n.color : n.color;
|
|
290
|
-
const alpha = readColor(outline, n.scheme, "line", "borderColor", null, put, at);
|
|
291
|
-
const width = nonEmpty(get("penwidth")) ?? setLineWidth(tokens);
|
|
292
|
-
if (alpha === 0) {
|
|
293
|
-
put("borderWidth", 0);
|
|
294
|
-
} else if (width !== null) {
|
|
295
|
-
put("borderWidth", penWidth(width, get("penwidth") !== null, at("borderWidth")));
|
|
296
|
-
} else if (tokens.includes("bold")) {
|
|
297
|
-
put("borderWidth", 2);
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
if (tokens.includes("dashed")) {
|
|
301
|
-
put("borderStyle", "dashed");
|
|
302
|
-
} else if (tokens.includes("dotted")) {
|
|
303
|
-
put("borderStyle", "dotted");
|
|
304
|
-
}
|
|
305
|
-
}
|
|
306
|
-
function readNodeShape(n) {
|
|
307
|
-
const rounded = n.tokens.includes("rounded");
|
|
308
|
-
if (n.cx.cluster) {
|
|
309
|
-
n.put("shape", rounded ? "round-rectangle" : "rectangle");
|
|
310
|
-
} else if (n.shapeRaw !== null) {
|
|
311
|
-
n.put(
|
|
312
|
-
"shape",
|
|
313
|
-
rounded && BOX_LIKE.has(n.shape) ? "round-rectangle" : canonEnum("shape", n.shapeRaw, "graphviz", n.at("shape"))
|
|
314
|
-
);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
function penWidth(raw, attribute, site) {
|
|
318
|
-
const value = Number(raw.trim());
|
|
319
|
-
if (attribute && Number.isFinite(value) && value < 0) {
|
|
320
|
-
noteAt(site, STYLE_ISSUE.BAD_VALUE, raw.slice(0, MAX_STYLE_VALUE_LENGTH));
|
|
321
|
-
return 0;
|
|
322
|
-
}
|
|
323
|
-
return canonNumber(raw, site);
|
|
324
|
-
}
|
|
325
|
-
function readSize(get, shape, point, label, put, at) {
|
|
326
|
-
let w = inches(get("width"), at("width"));
|
|
327
|
-
let h = inches(get("height"), at("height"));
|
|
328
|
-
const same = point || CIRCLE_LIKE.has(shape) || isTrue(get("regular"));
|
|
329
|
-
if (shape === "plain") {
|
|
330
|
-
w = h = 0;
|
|
331
|
-
} else if (w === null && h === null) {
|
|
332
|
-
if (point) {
|
|
333
|
-
put("width", num6(POINT_SIZE * DOT_POINTS_PER_INCH));
|
|
334
|
-
put("height", num6(POINT_SIZE * DOT_POINTS_PER_INCH));
|
|
335
|
-
return;
|
|
336
|
-
}
|
|
337
|
-
if (!same) {
|
|
338
|
-
return;
|
|
339
|
-
}
|
|
340
|
-
w = h = REGULAR_SIZE;
|
|
341
|
-
}
|
|
342
|
-
let ww = w;
|
|
343
|
-
let hh = h;
|
|
344
|
-
if (point) {
|
|
345
|
-
ww = hh = Math.min(w ?? Infinity, h ?? Infinity);
|
|
346
|
-
} else if (same) {
|
|
347
|
-
ww = hh = Math.max(w ?? 0, h ?? 0);
|
|
348
|
-
}
|
|
349
|
-
const exact = point || isTrue(get("fixedsize")) || label === "" && !RECORD.has(shape);
|
|
350
|
-
if (!exact) {
|
|
351
|
-
noteAt(at("width"), STYLE_ISSUE.SIZE_MINIMUM, "grows to fit its label");
|
|
352
|
-
}
|
|
353
|
-
put("width", ww === null ? null : canonNumber(ww, at("width"), DOT_POINTS_PER_INCH));
|
|
354
|
-
put("height", hh === null ? null : canonNumber(hh, at("height"), DOT_POINTS_PER_INCH));
|
|
355
|
-
}
|
|
356
|
-
function readEdge(get, cx, put, at) {
|
|
357
|
-
const tokens = styleTokens(get("style"), at("visible"));
|
|
358
|
-
const scheme = get("colorscheme");
|
|
359
|
-
readCommon(get, tokens, scheme, cx.names, put, at);
|
|
360
|
-
readColor(nonEmpty(get("color")), scheme, "edge", "color", "opacity", put, at);
|
|
361
|
-
readEdgeLine(get, tokens, put, at);
|
|
362
|
-
readEdgeArrows(get, cx, put, at);
|
|
363
|
-
for (const [attribute, property] of [
|
|
364
|
-
[LABEL_ATTRIBUTE, "label"],
|
|
365
|
-
["headlabel", "targetLabel"],
|
|
366
|
-
["taillabel", "sourceLabel"]
|
|
367
|
-
]) {
|
|
368
|
-
const raw = get(attribute);
|
|
369
|
-
if (raw !== null) {
|
|
370
|
-
put(property, labelText(raw, cx.names, cx.html, false, at(property)));
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
if (nonEmpty(get("xlabel")) !== null) {
|
|
374
|
-
noteAt(at("label"), STYLE_ISSUE.NOT_CARRIED, "xlabel");
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
function readEdgeLine(get, tokens, put, at) {
|
|
378
|
-
const width = nonEmpty(get("penwidth")) ?? setLineWidth(tokens);
|
|
379
|
-
if (width !== null) {
|
|
380
|
-
put("width", penWidth(width, get("penwidth") !== null, at("width")));
|
|
381
|
-
} else if (tokens.includes("bold")) {
|
|
382
|
-
put("width", 2);
|
|
383
|
-
}
|
|
384
|
-
if (tokens.includes("dashed")) {
|
|
385
|
-
put("lineStyle", "dashed");
|
|
386
|
-
} else if (tokens.includes("dotted")) {
|
|
387
|
-
put("lineStyle", "dotted");
|
|
388
|
-
} else if (tokens.includes("solid") || tokens.includes("bold")) {
|
|
389
|
-
put("lineStyle", "solid");
|
|
390
|
-
} else if (tokens.includes("tapered")) {
|
|
391
|
-
put("lineStyle", "other:tapered");
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
function readEdgeArrows(get, cx, put, at) {
|
|
395
|
-
const dirRaw = nonEmpty(get("dir"));
|
|
396
|
-
const head = nonEmpty(get("arrowhead"));
|
|
397
|
-
const tail = nonEmpty(get("arrowtail"));
|
|
398
|
-
if (dirRaw !== null || head !== null || tail !== null) {
|
|
399
|
-
const dir = (dirRaw ?? (cx.directed ? "forward" : "none")).trim().toLowerCase();
|
|
400
|
-
const forward = dir === "forward" || dir === "both";
|
|
401
|
-
const back = dir === "back" || dir === "both";
|
|
402
|
-
put("targetArrow", forward ? canonEnum("arrow", head ?? "normal", "graphviz", at("targetArrow")) : "none");
|
|
403
|
-
put("sourceArrow", back ? canonEnum("arrow", tail ?? "normal", "graphviz", at("sourceArrow")) : "none");
|
|
404
|
-
}
|
|
405
|
-
const size = get("arrowsize");
|
|
406
|
-
if (size !== null) {
|
|
407
|
-
put("arrowSize", canonNumber(size, at("arrowSize")));
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
function htmlStrings(snapshot) {
|
|
411
|
-
const out = /* @__PURE__ */ new Set();
|
|
412
|
-
for (let i = 0; i < snapshot.nodeCount; i++) {
|
|
413
|
-
const id = snapshot.ids.idOf(i);
|
|
414
|
-
if (typeof id === "string" && isHtmlString(id)) {
|
|
415
|
-
out.add(id);
|
|
416
|
-
}
|
|
417
|
-
}
|
|
418
|
-
for (const [table, n] of [
|
|
419
|
-
[snapshot.nodes, snapshot.nodeCount],
|
|
420
|
-
[snapshot.edges, snapshot.edgeCount]
|
|
421
|
-
]) {
|
|
422
|
-
for (const name of [LABEL_ATTRIBUTE, "headlabel", "taillabel"].filter((c) => table.has(c))) {
|
|
423
|
-
addHtmlCells(table, name, n, out);
|
|
424
|
-
}
|
|
425
|
-
}
|
|
426
|
-
return out;
|
|
427
|
-
}
|
|
428
|
-
function addHtmlCells(table, name, n, out) {
|
|
429
|
-
for (let i = 0; i < n; i++) {
|
|
430
|
-
const v = cellText$1(table, name, i);
|
|
431
|
-
if (v !== null && isHtmlString(v)) {
|
|
432
|
-
out.add(v);
|
|
433
|
-
}
|
|
434
|
-
}
|
|
435
|
-
}
|
|
436
|
-
function directedEdges(snapshot) {
|
|
437
|
-
const out = new Array(snapshot.edgeCount).fill(snapshot.directed);
|
|
438
|
-
const col = snapshot.directed ? snapshot.edges.byRole("directed") : null;
|
|
439
|
-
if (col !== null) {
|
|
440
|
-
for (let e = 0; e < snapshot.edgeCount; e++) {
|
|
441
|
-
const v = plainCell(col.value(e));
|
|
442
|
-
if (typeof v === "boolean") {
|
|
443
|
-
out[e] = v;
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
}
|
|
447
|
-
return out;
|
|
448
|
-
}
|
|
449
|
-
function isCluster(snapshot, i) {
|
|
450
|
-
return snapshot.nodes.has(CLUSTER_COLUMN) && snapshot.nodes.value(CLUSTER_COLUMN, i) === true;
|
|
451
|
-
}
|
|
452
|
-
function contexts(snapshot, written = null) {
|
|
453
|
-
const html = htmlStrings(snapshot);
|
|
454
|
-
const graph = snapshot.meta.name ?? "";
|
|
455
|
-
const own = directedEdges(snapshot);
|
|
456
|
-
const directed = written === null || own.every((d) => d === snapshot.directed) ? own : own.map(() => written);
|
|
457
|
-
const name = (i) => String(snapshot.ids.idOf(i));
|
|
458
|
-
return {
|
|
459
|
-
node: (i) => ({ name: name(i), graph, cluster: isCluster(snapshot, i), html }),
|
|
460
|
-
edge: (e) => {
|
|
461
|
-
const tail = name(snapshot.edgeSource(e));
|
|
462
|
-
const head = name(snapshot.edgeTarget(e));
|
|
463
|
-
return {
|
|
464
|
-
names: { graph, tail, head, edge: `${tail}${directed[e] ? "->" : "--"}${head}` },
|
|
465
|
-
directed: directed[e],
|
|
466
|
-
html
|
|
467
|
-
};
|
|
468
|
-
}
|
|
469
|
-
};
|
|
470
|
-
}
|
|
471
|
-
function defaultLabel(cx, shape, notes) {
|
|
472
|
-
if (cx.cluster || shape === "point") {
|
|
473
|
-
return null;
|
|
474
|
-
}
|
|
475
|
-
const at = { notes, target: "node", property: "label" };
|
|
476
|
-
return isHtmlString(cx.name) ? htmlLabelText(cx.name, at) : dotLabelText(String.raw`\N`, { node: cx.name, graph: cx.graph }, at);
|
|
477
|
-
}
|
|
478
|
-
function styleColumns(table, attributes) {
|
|
479
|
-
const own = /* @__PURE__ */ new Set([...attributes, ...NOTED_ATTRIBUTES]);
|
|
480
|
-
return [...table.names()].filter((c) => own.has(c) || c.startsWith("graphty.style."));
|
|
481
|
-
}
|
|
482
|
-
function dotStyles(snapshot, context) {
|
|
483
|
-
const notes = new StyleNotes();
|
|
484
|
-
const cx = contexts(snapshot);
|
|
485
|
-
const node = valueColumns(snapshot.nodeCount);
|
|
486
|
-
const nameColumn = new Array(snapshot.nodeCount).fill(null);
|
|
487
|
-
const clusterColumn = new Array(snapshot.nodeCount).fill(null);
|
|
488
|
-
let named = 0;
|
|
489
|
-
let clusters = 0;
|
|
490
|
-
for (let i = 0; i < snapshot.nodeCount; i++) {
|
|
491
|
-
context.budget.spend("node", NODE_ATTRIBUTES.length);
|
|
492
|
-
const get = (name) => cellText$1(snapshot.nodes, name, i);
|
|
493
|
-
const ncx = cx.node(i);
|
|
494
|
-
const at = (property) => ({ notes, target: "node", property, element: i, budget: context.budget });
|
|
495
|
-
readNode(
|
|
496
|
-
get,
|
|
497
|
-
ncx,
|
|
498
|
-
(p, v) => {
|
|
499
|
-
node.put(i, p, v);
|
|
500
|
-
},
|
|
501
|
-
at
|
|
502
|
-
);
|
|
503
|
-
const shown = defaultLabel(ncx, (get("shape") ?? "").toLowerCase(), notes);
|
|
504
|
-
if (shown !== null) {
|
|
505
|
-
nameColumn[i] = shown;
|
|
506
|
-
named++;
|
|
507
|
-
}
|
|
508
|
-
if (ncx.cluster) {
|
|
509
|
-
clusterColumn[i] = true;
|
|
510
|
-
clusters++;
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
const edge = valueColumns(snapshot.edgeCount);
|
|
514
|
-
for (let e = 0; e < snapshot.edgeCount; e++) {
|
|
515
|
-
context.budget.spend("edge", EDGE_ATTRIBUTES.length);
|
|
516
|
-
const get = (name) => cellText$1(snapshot.edges, name, e);
|
|
517
|
-
const at = (property) => ({ notes, target: "edge", property, element: e, budget: context.budget });
|
|
518
|
-
readEdge(
|
|
519
|
-
get,
|
|
520
|
-
cx.edge(e),
|
|
521
|
-
(p, v) => {
|
|
522
|
-
edge.put(e, p, v);
|
|
523
|
-
},
|
|
524
|
-
at
|
|
525
|
-
);
|
|
526
|
-
}
|
|
527
|
-
const graph = {};
|
|
528
|
-
const bg = nonEmpty(cellText$1(snapshot.graph, "bgcolor", 0));
|
|
529
|
-
if (snapshot.graph.has("bgcolor") && bg !== null) {
|
|
530
|
-
readColor(
|
|
531
|
-
bg,
|
|
532
|
-
cellText$1(snapshot.graph, "colorscheme", 0),
|
|
533
|
-
"fill",
|
|
534
|
-
"background",
|
|
535
|
-
null,
|
|
536
|
-
(p, v) => {
|
|
537
|
-
if (v !== null) {
|
|
538
|
-
graph[p] = v;
|
|
539
|
-
}
|
|
540
|
-
},
|
|
541
|
-
(property) => ({ notes, target: "graph", property })
|
|
542
|
-
);
|
|
543
|
-
}
|
|
544
|
-
const blockText = cellText$1(snapshot.graph, STYLE_BLOCK_NAME, 0);
|
|
545
|
-
if (blockText !== null) {
|
|
546
|
-
exactFromBlock(snapshot, blockText, { node: node.values, edge: edge.values }, cx);
|
|
547
|
-
}
|
|
548
|
-
const nodeRules = [];
|
|
549
|
-
const nodeColumns = /* @__PURE__ */ new Map();
|
|
550
|
-
if (named > 0) {
|
|
551
|
-
nodeColumns.set(NAME_KEY, nameColumn);
|
|
552
|
-
nodeRules.push({
|
|
553
|
-
id: "node.tool.name-label",
|
|
554
|
-
target: "node",
|
|
555
|
-
role: "passthrough",
|
|
556
|
-
origin: "tool",
|
|
557
|
-
where: { has: { style: NAME_KEY } },
|
|
558
|
-
map: { label: { kind: "passthrough", by: { style: NAME_KEY } } },
|
|
559
|
-
facts: { elements: named, reason: "NODE_NAME" }
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
const features = clusters > 0 ? [{ ref: { style: CLUSTER_KEY }, values: clusterColumn }] : [];
|
|
563
|
-
const edgeRules = [];
|
|
564
|
-
const edgeColumns = /* @__PURE__ */ new Map();
|
|
565
|
-
const directed = directedEdges(snapshot);
|
|
566
|
-
if (directed.some(Boolean)) {
|
|
567
|
-
edgeColumns.set(
|
|
568
|
-
DIRECTED_KEY,
|
|
569
|
-
directed.map((d) => d ? true : null)
|
|
570
|
-
);
|
|
571
|
-
edgeRules.push({
|
|
572
|
-
id: "edge.tool.arrow",
|
|
573
|
-
target: "edge",
|
|
574
|
-
role: "group",
|
|
575
|
-
origin: "tool",
|
|
576
|
-
where: { has: { style: DIRECTED_KEY } },
|
|
577
|
-
set: { targetArrow: "triangle" }
|
|
578
|
-
});
|
|
579
|
-
}
|
|
580
|
-
return {
|
|
581
|
-
canonical: true,
|
|
582
|
-
dialect: "graphviz",
|
|
583
|
-
tool: "graphviz",
|
|
584
|
-
units: "px",
|
|
585
|
-
node: { values: node.values, rules: nodeRules, columns: nodeColumns, features },
|
|
586
|
-
edge: { values: edge.values, rules: edgeRules, columns: edgeColumns },
|
|
587
|
-
graph,
|
|
588
|
-
notes: notes.list(),
|
|
589
|
-
readFrom: {
|
|
590
|
-
node: styleColumns(snapshot.nodes, NODE_ATTRIBUTES),
|
|
591
|
-
edge: styleColumns(snapshot.edges, EDGE_ATTRIBUTES)
|
|
592
|
-
}
|
|
593
|
-
};
|
|
594
|
-
}
|
|
595
|
-
const SHAPES = /* @__PURE__ */ new Map([
|
|
596
|
-
["ellipse", "ellipse"],
|
|
597
|
-
["rectangle", "box"],
|
|
598
|
-
["round-rectangle", "box"],
|
|
599
|
-
["triangle", "triangle"],
|
|
600
|
-
["diamond", "diamond"],
|
|
601
|
-
["pentagon", "pentagon"],
|
|
602
|
-
["hexagon", "hexagon"],
|
|
603
|
-
["octagon", "octagon"],
|
|
604
|
-
["parallelogram", "parallelogram"],
|
|
605
|
-
["trapezoid", "trapezium"],
|
|
606
|
-
["star", "star"],
|
|
607
|
-
["none", "none"]
|
|
608
|
-
]);
|
|
609
|
-
const ARROWS = /* @__PURE__ */ new Map([
|
|
610
|
-
["none", "none"],
|
|
611
|
-
["triangle", "normal"],
|
|
612
|
-
["triangle-open", "onormal"],
|
|
613
|
-
["vee", "vee"],
|
|
614
|
-
["tee", "tee"],
|
|
615
|
-
["diamond", "diamond"],
|
|
616
|
-
["diamond-open", "odiamond"],
|
|
617
|
-
["circle", "dot"],
|
|
618
|
-
["circle-open", "odot"],
|
|
619
|
-
["square", "box"],
|
|
620
|
-
["crow", "crow"],
|
|
621
|
-
["half", "lnormal"],
|
|
622
|
-
["inverted", "inv"]
|
|
623
|
-
]);
|
|
624
|
-
const STROKES = /* @__PURE__ */ new Map([
|
|
625
|
-
["dashed", "dashed"],
|
|
626
|
-
["dotted", "dotted"]
|
|
627
|
-
]);
|
|
628
|
-
function graphvizDefaults(target) {
|
|
629
|
-
const t = toolDefaults("graphviz")?.[target];
|
|
630
|
-
const out = /* @__PURE__ */ new Map();
|
|
631
|
-
const add = (attribute, property, scale = 1) => {
|
|
632
|
-
const v = t[property]?.value;
|
|
633
|
-
if (typeof v === "number") {
|
|
634
|
-
out.set(attribute, num6(v / scale));
|
|
635
|
-
} else if (typeof v === "string") {
|
|
636
|
-
out.set(attribute, v);
|
|
637
|
-
}
|
|
638
|
-
};
|
|
639
|
-
add("fontcolor", "labelColor");
|
|
640
|
-
add("fontsize", "labelSize");
|
|
641
|
-
add("fontname", "labelFont");
|
|
642
|
-
if (target === "node") {
|
|
643
|
-
add("color", "borderColor");
|
|
644
|
-
add("pencolor", "borderColor");
|
|
645
|
-
add("penwidth", "borderWidth");
|
|
646
|
-
add("shape", "shape");
|
|
647
|
-
add("width", "width", DOT_POINTS_PER_INCH);
|
|
648
|
-
add("height", "height", DOT_POINTS_PER_INCH);
|
|
649
|
-
} else {
|
|
650
|
-
add("color", "color");
|
|
651
|
-
add("penwidth", "width");
|
|
652
|
-
add("arrowsize", "arrowSize");
|
|
653
|
-
}
|
|
654
|
-
return out;
|
|
655
|
-
}
|
|
656
|
-
const DEFAULT_ATTRIBUTES = {
|
|
657
|
-
node: graphvizDefaults("node"),
|
|
658
|
-
edge: graphvizDefaults("edge")
|
|
659
|
-
};
|
|
660
|
-
function withoutDefaults(out, target) {
|
|
661
|
-
for (const [attribute, value] of DEFAULT_ATTRIBUTES[target]) {
|
|
662
|
-
if (out.get(attribute) === value) {
|
|
663
|
-
out.delete(attribute);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
if (!out.has("width") && !out.has("height")) {
|
|
667
|
-
out.delete("fixedsize");
|
|
668
|
-
}
|
|
669
|
-
return out;
|
|
670
|
-
}
|
|
671
|
-
function gvColor(color, opacity) {
|
|
672
|
-
if (typeof opacity !== "number" || opacity >= 1) {
|
|
673
|
-
return color;
|
|
674
|
-
}
|
|
675
|
-
const a = Math.max(0, Math.min(255, Math.round(opacity * 255)));
|
|
676
|
-
return color + a.toString(16).padStart(2, "0");
|
|
677
|
-
}
|
|
678
|
-
function escapeLabel(text) {
|
|
679
|
-
return text.replaceAll("\\", String.raw`\\`).replaceAll("\n", String.raw`\n`);
|
|
680
|
-
}
|
|
681
|
-
function spelled(table, value, nearest, property, approximate) {
|
|
682
|
-
const exact = table.get(value);
|
|
683
|
-
if (exact !== void 0) {
|
|
684
|
-
return exact;
|
|
685
|
-
}
|
|
686
|
-
if (value.startsWith("other:")) {
|
|
687
|
-
return value.slice("other:".length);
|
|
688
|
-
}
|
|
689
|
-
approximate(property, value);
|
|
690
|
-
return nearest;
|
|
691
|
-
}
|
|
692
|
-
function writeCommon(get, out, tokens) {
|
|
693
|
-
const color = get("labelColor");
|
|
694
|
-
if (typeof color === "string") {
|
|
695
|
-
out.set("fontcolor", color);
|
|
696
|
-
}
|
|
697
|
-
const size = get("labelSize");
|
|
698
|
-
if (typeof size === "number") {
|
|
699
|
-
out.set("fontsize", size);
|
|
700
|
-
}
|
|
701
|
-
const font = get("labelFont");
|
|
702
|
-
if (typeof font === "string") {
|
|
703
|
-
out.set("fontname", font);
|
|
704
|
-
}
|
|
705
|
-
const tip = get("tooltip");
|
|
706
|
-
if (typeof tip === "string") {
|
|
707
|
-
out.set("tooltip", escapeLabel(tip));
|
|
708
|
-
}
|
|
709
|
-
if (get("visible") === false) {
|
|
710
|
-
tokens.push("invis");
|
|
711
|
-
}
|
|
712
|
-
}
|
|
713
|
-
function nodeAttributes(get, cx, approximate, notes) {
|
|
714
|
-
const out = /* @__PURE__ */ new Map();
|
|
715
|
-
const tokens = [];
|
|
716
|
-
writeCommon(get, out, tokens);
|
|
717
|
-
writeNodeOutline(get, cx, approximate, out, tokens);
|
|
718
|
-
const gvShape = writeNodeShape(get, cx, approximate, out, tokens);
|
|
719
|
-
if (!cx.cluster) {
|
|
720
|
-
writeNodeSize(get, out);
|
|
721
|
-
}
|
|
722
|
-
const label = get("label");
|
|
723
|
-
const shown = defaultLabel(cx, gvShape, notes);
|
|
724
|
-
if (typeof label === "string" && label !== shown) {
|
|
725
|
-
out.set(LABEL_ATTRIBUTE, escapeLabel(label));
|
|
726
|
-
} else if (label === null && shown !== null) {
|
|
727
|
-
out.set(LABEL_ATTRIBUTE, "");
|
|
728
|
-
}
|
|
729
|
-
if (tokens.length > 0) {
|
|
730
|
-
out.set("style", tokens.join(","));
|
|
731
|
-
}
|
|
732
|
-
return withoutDefaults(out, "node");
|
|
733
|
-
}
|
|
734
|
-
function writeNodeOutline(get, cx, approximate, out, tokens) {
|
|
735
|
-
const fill = get("fill");
|
|
736
|
-
const fillOpacity = get("fillOpacity");
|
|
737
|
-
if (typeof fill === "string" && fillOpacity !== 0) {
|
|
738
|
-
tokens.push("filled");
|
|
739
|
-
out.set("fillcolor", gvColor(fill, fillOpacity));
|
|
740
|
-
}
|
|
741
|
-
const border = get("borderColor");
|
|
742
|
-
if (typeof border === "string") {
|
|
743
|
-
out.set(cx.cluster ? "pencolor" : "color", border);
|
|
744
|
-
}
|
|
745
|
-
const borderWidth = get("borderWidth");
|
|
746
|
-
if (typeof borderWidth === "number") {
|
|
747
|
-
out.set("penwidth", borderWidth);
|
|
748
|
-
}
|
|
749
|
-
const borderStyle = get("borderStyle");
|
|
750
|
-
if (typeof borderStyle === "string" && borderStyle !== "solid") {
|
|
751
|
-
const nearest = borderStyle.includes("dash") ? "dashed" : "solid";
|
|
752
|
-
tokens.push(spelled(STROKES, borderStyle, nearest, "borderStyle", approximate));
|
|
753
|
-
}
|
|
754
|
-
}
|
|
755
|
-
function writeNodeShape(get, cx, approximate, out, tokens) {
|
|
756
|
-
const shape = get("shape");
|
|
757
|
-
if (typeof shape !== "string") {
|
|
758
|
-
return "";
|
|
759
|
-
}
|
|
760
|
-
if (shape === "round-rectangle") {
|
|
761
|
-
tokens.push("rounded");
|
|
762
|
-
}
|
|
763
|
-
if (cx.cluster) {
|
|
764
|
-
if (shape !== "rectangle" && shape !== "round-rectangle") {
|
|
765
|
-
approximate("shape", shape);
|
|
766
|
-
}
|
|
767
|
-
return "";
|
|
768
|
-
}
|
|
769
|
-
const gvShape = spelled(SHAPES, shape, shape === "vee" ? "invtriangle" : "box", "shape", approximate);
|
|
770
|
-
out.set("shape", gvShape);
|
|
771
|
-
return gvShape;
|
|
772
|
-
}
|
|
773
|
-
function writeNodeSize(get, out) {
|
|
774
|
-
const width = get("width");
|
|
775
|
-
const height = get("height");
|
|
776
|
-
if (typeof width === "number" || typeof height === "number") {
|
|
777
|
-
out.set("fixedsize", "true");
|
|
778
|
-
}
|
|
779
|
-
if (typeof width === "number") {
|
|
780
|
-
out.set("width", inchesOf(width));
|
|
781
|
-
}
|
|
782
|
-
if (typeof height === "number") {
|
|
783
|
-
out.set("height", inchesOf(height));
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
function edgeAttributes(get, directed, approximate) {
|
|
787
|
-
const out = /* @__PURE__ */ new Map();
|
|
788
|
-
const tokens = [];
|
|
789
|
-
writeCommon(get, out, tokens);
|
|
790
|
-
const color = get("color");
|
|
791
|
-
if (typeof color === "string") {
|
|
792
|
-
out.set("color", gvColor(color, get("opacity")));
|
|
793
|
-
}
|
|
794
|
-
const width = get("width");
|
|
795
|
-
if (typeof width === "number") {
|
|
796
|
-
out.set("penwidth", width);
|
|
797
|
-
}
|
|
798
|
-
const line = get("lineStyle");
|
|
799
|
-
if (typeof line === "string" && line !== "solid") {
|
|
800
|
-
tokens.push(spelled(STROKES, line, line.includes("dash") ? "dashed" : "solid", "lineStyle", approximate));
|
|
801
|
-
}
|
|
802
|
-
writeEdgeArrows(get, directed, approximate, out);
|
|
803
|
-
const arrowSize = get("arrowSize");
|
|
804
|
-
if (typeof arrowSize === "number") {
|
|
805
|
-
out.set("arrowsize", arrowSize);
|
|
806
|
-
}
|
|
807
|
-
for (const [property, attribute] of [
|
|
808
|
-
["label", LABEL_ATTRIBUTE],
|
|
809
|
-
["targetLabel", "headlabel"],
|
|
810
|
-
["sourceLabel", "taillabel"]
|
|
811
|
-
]) {
|
|
812
|
-
const v = get(property);
|
|
813
|
-
if (typeof v === "string") {
|
|
814
|
-
out.set(attribute, escapeLabel(v));
|
|
815
|
-
}
|
|
816
|
-
}
|
|
817
|
-
if (tokens.length > 0) {
|
|
818
|
-
out.set("style", tokens.join(","));
|
|
819
|
-
}
|
|
820
|
-
return withoutDefaults(out, "edge");
|
|
821
|
-
}
|
|
822
|
-
function writeEdgeArrows(get, directed, approximate, out) {
|
|
823
|
-
const source = get("sourceArrow");
|
|
824
|
-
const target = get("targetArrow");
|
|
825
|
-
const tail = typeof source === "string" && source !== "none";
|
|
826
|
-
const head = typeof target === "string" && target !== "none";
|
|
827
|
-
const plain = directed ? head && !tail && target === "triangle" : !head && !tail;
|
|
828
|
-
if (plain || source === null && target === null) {
|
|
829
|
-
return;
|
|
830
|
-
}
|
|
831
|
-
let dir = "none";
|
|
832
|
-
if (head && tail) {
|
|
833
|
-
dir = "both";
|
|
834
|
-
} else if (head) {
|
|
835
|
-
dir = "forward";
|
|
836
|
-
} else if (tail) {
|
|
837
|
-
dir = "back";
|
|
838
|
-
}
|
|
839
|
-
out.set("dir", dir);
|
|
840
|
-
if (head) {
|
|
841
|
-
out.set("arrowhead", spelled(ARROWS, target, "normal", "targetArrow", approximate));
|
|
842
|
-
}
|
|
843
|
-
if (tail) {
|
|
844
|
-
out.set("arrowtail", spelled(ARROWS, source, "normal", "sourceArrow", approximate));
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
function getter(picture, target) {
|
|
848
|
-
const columns = /* @__PURE__ */ new Map();
|
|
849
|
-
for (const p of DOT_STYLE_CAPABILITIES[target]) {
|
|
850
|
-
columns.set(p, picture(target, p));
|
|
851
|
-
}
|
|
852
|
-
return (i) => (property) => columns.get(property)?.[i] ?? null;
|
|
853
|
-
}
|
|
854
|
-
function exactFromBlock(snapshot, text, read, cx) {
|
|
855
|
-
const parsed = parseStyleBlock(text, styleFingerprint(snapshot));
|
|
856
|
-
const ex = parsed.ok ? blockStyles(parsed.block, snapshot, "dot") : null;
|
|
857
|
-
if (ex === null) {
|
|
858
|
-
return;
|
|
859
|
-
}
|
|
860
|
-
const notes = new StyleNotes();
|
|
861
|
-
for (const target of ["node", "edge"]) {
|
|
862
|
-
const n = target === "node" ? snapshot.nodeCount : snapshot.edgeCount;
|
|
863
|
-
const get = getter((t, p) => resolveStyles(ex, t, p, snapshot), target);
|
|
864
|
-
const values = read[target];
|
|
865
|
-
for (let i = 0; i < n; i++) {
|
|
866
|
-
const want = get(i);
|
|
867
|
-
const back = writtenAndReadBack(target, i, want, cx, notes);
|
|
868
|
-
for (const property of DOT_STYLE_CAPABILITIES[target]) {
|
|
869
|
-
const native = values[property]?.[i] ?? null;
|
|
870
|
-
const w = want(property);
|
|
871
|
-
if (native !== w && native === (back.get(property) ?? null)) {
|
|
872
|
-
values[property] ??= new Array(n).fill(null);
|
|
873
|
-
values[property][i] = w;
|
|
874
|
-
}
|
|
875
|
-
}
|
|
876
|
-
}
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
function writtenAndReadBack(target, i, want, cx, notes) {
|
|
880
|
-
const ignore = () => void 0;
|
|
881
|
-
const back = /* @__PURE__ */ new Map();
|
|
882
|
-
const put = (property, value) => {
|
|
883
|
-
if (value !== null) {
|
|
884
|
-
back.set(property, value);
|
|
885
|
-
}
|
|
886
|
-
};
|
|
887
|
-
const at = (property) => ({ notes, target, property });
|
|
888
|
-
if (target === "node") {
|
|
889
|
-
const ncx = cx.node(i);
|
|
890
|
-
const attrs = nodeAttributes(want, ncx, ignore, notes);
|
|
891
|
-
readNode((name) => textOf(attrs.get(name)), ncx, put, at);
|
|
892
|
-
} else {
|
|
893
|
-
const ecx = cx.edge(i);
|
|
894
|
-
const attrs = edgeAttributes(want, ecx.directed, ignore);
|
|
895
|
-
readEdge((name) => textOf(attrs.get(name)), ecx, put, at);
|
|
896
|
-
}
|
|
897
|
-
return back;
|
|
898
|
-
}
|
|
899
|
-
function textOf(v) {
|
|
900
|
-
return v === void 0 ? null : String(v);
|
|
901
|
-
}
|
|
902
|
-
function readsBack(col) {
|
|
903
|
-
const vals = col.filter((v) => v !== null);
|
|
904
|
-
if (vals.every((v) => typeof v === "number")) {
|
|
905
|
-
return vals.every((v) => Number.isFinite(v));
|
|
906
|
-
}
|
|
907
|
-
if (vals.every((v) => typeof v === "boolean")) {
|
|
908
|
-
return true;
|
|
909
|
-
}
|
|
910
|
-
if (vals.every((v) => typeof v === "string")) {
|
|
911
|
-
return vals.some((v) => inferTextDtype(v) === "string") && vals.every((v) => isWritableDotText(v));
|
|
912
|
-
}
|
|
913
|
-
return false;
|
|
914
|
-
}
|
|
915
|
-
function dotSafeJson(json) {
|
|
916
|
-
return json.replaceAll(/\\(["\\])/g, (_m, c) => c === '"' ? String.raw`\u0022` : String.raw`\u005c`);
|
|
917
|
-
}
|
|
918
|
-
function dotStyledExport(snapshot, input, onMixedDirection) {
|
|
919
|
-
if (input === void 0) {
|
|
920
|
-
return null;
|
|
921
|
-
}
|
|
922
|
-
return sharedInExportCall(
|
|
923
|
-
input,
|
|
924
|
-
[snapshot, onMixedDirection],
|
|
925
|
-
() => styledExport(snapshot, input, onMixedDirection)
|
|
926
|
-
);
|
|
927
|
-
}
|
|
928
|
-
function styledExport(snapshot, input, onMixedDirection) {
|
|
929
|
-
const approximated = new StyleApproximations();
|
|
930
|
-
const replaced = [];
|
|
931
|
-
const out = snapshot.withColumns();
|
|
932
|
-
const written = onMixedDirection === "directed" || onMixedDirection === "undirected";
|
|
933
|
-
const cx = contexts(snapshot, written ? onMixedDirection === "directed" : null);
|
|
934
|
-
const notes = new StyleNotes();
|
|
935
|
-
for (const target of ["node", "edge"]) {
|
|
936
|
-
const table = target === "node" ? out.nodes : out.edges;
|
|
937
|
-
const read = dataRead(input.rules.styles.rules, target);
|
|
938
|
-
const approximate = (property, value) => {
|
|
939
|
-
approximated.add(target, property, value);
|
|
940
|
-
};
|
|
941
|
-
const columns = attributeColumns(snapshot, input, target, { cx, approximate, notes, read });
|
|
942
|
-
replaced.push(...removeStyleAttributes(table, target, columns, read));
|
|
943
|
-
setAttributeColumns(table, columns);
|
|
944
|
-
}
|
|
945
|
-
const { background } = input.rules.styles.graph;
|
|
946
|
-
if (out.graph.has("bgcolor")) {
|
|
947
|
-
out.graph.remove("bgcolor");
|
|
948
|
-
}
|
|
949
|
-
if (typeof background === "string") {
|
|
950
|
-
out.graph.set("bgcolor", [background], { dtype: "string" });
|
|
951
|
-
}
|
|
952
|
-
const inline = [...input.tags.node.values(), ...input.tags.edge.values()].some((col) => !readsBack(col));
|
|
953
|
-
if (!inline) {
|
|
954
|
-
setTagColumns(out, input);
|
|
955
|
-
}
|
|
956
|
-
const block = inline ? writeStyleBlock(input.rules, { inlineColumns: true, snapshot }) : input.block;
|
|
957
|
-
out.graph.set(STYLE_BLOCK_NAME, [dotSafeJson(block)], { dtype: "string" });
|
|
958
|
-
const losses = approximated.notes("Graphviz");
|
|
959
|
-
if (inline) {
|
|
960
|
-
losses.push(...styleBlockLosses(block, input.rules.styles.rules.length, "size"));
|
|
961
|
-
}
|
|
962
|
-
return { snapshot: out, notes: [...replaced, ...losses] };
|
|
963
|
-
}
|
|
964
|
-
function attributeColumns(snapshot, input, target, w) {
|
|
965
|
-
const n = target === "node" ? snapshot.nodeCount : snapshot.edgeCount;
|
|
966
|
-
const get = getter((t, p) => input.picture(t, p), target);
|
|
967
|
-
const columns = /* @__PURE__ */ new Map();
|
|
968
|
-
for (let i = 0; i < n; i++) {
|
|
969
|
-
const attrs = target === "node" ? nodeAttributes(get(i), w.cx.node(i), w.approximate, w.notes) : edgeAttributes(get(i), w.cx.edge(i).directed, w.approximate);
|
|
970
|
-
if (w.read.has(LABEL_ATTRIBUTE) && attrs.get(LABEL_ATTRIBUTE) === "" && get(i)("label") === null) {
|
|
971
|
-
w.approximate("label", "");
|
|
972
|
-
}
|
|
973
|
-
for (const [name, value] of attrs) {
|
|
974
|
-
let col = columns.get(name);
|
|
975
|
-
if (col === void 0) {
|
|
976
|
-
col = new Array(n).fill(null);
|
|
977
|
-
columns.set(name, col);
|
|
978
|
-
}
|
|
979
|
-
col[i] = value;
|
|
980
|
-
}
|
|
981
|
-
}
|
|
982
|
-
return columns;
|
|
983
|
-
}
|
|
984
|
-
function removeStyleAttributes(table, target, columns, read) {
|
|
985
|
-
const attributes = target === "node" ? NODE_ATTRIBUTES : EDGE_ATTRIBUTES;
|
|
986
|
-
const replaced = [];
|
|
987
|
-
for (const name of table.names()) {
|
|
988
|
-
if (!attributes.includes(name) && name !== LABEL_ATTRIBUTE && !name.startsWith("graphty.style.")) {
|
|
989
|
-
continue;
|
|
990
|
-
}
|
|
991
|
-
const differs = read.has(name) ? replacedRows(table, name, columns.get(name)) : 0;
|
|
992
|
-
if (differs > 0) {
|
|
993
|
-
replaced.push(
|
|
994
|
-
Object.freeze({
|
|
995
|
-
code: DOT_ATTRIBUTE_CLASH_CODE,
|
|
996
|
-
message: `${target} column "${name}" is not written: the ${name} attribute holds what graphty draws (${String(differs)} ${target}${differs === 1 ? "" : "s"} differ)`,
|
|
997
|
-
column: name,
|
|
998
|
-
count: differs
|
|
999
|
-
})
|
|
1000
|
-
);
|
|
1001
|
-
}
|
|
1002
|
-
table.remove(name);
|
|
1003
|
-
}
|
|
1004
|
-
return replaced;
|
|
1005
|
-
}
|
|
1006
|
-
function setAttributeColumns(table, columns) {
|
|
1007
|
-
for (const [name, col] of columns) {
|
|
1008
|
-
if (name === LABEL_ATTRIBUTE) {
|
|
1009
|
-
table.set(name, col, { dtype: "string", role: "label" }, { replaceRole: true });
|
|
1010
|
-
} else if (col.every((v) => v === null || typeof v === "number")) {
|
|
1011
|
-
table.set(name, col, { dtype: "f64" });
|
|
1012
|
-
} else {
|
|
1013
|
-
table.set(
|
|
1014
|
-
name,
|
|
1015
|
-
col.map((v) => v === null ? null : String(v)),
|
|
1016
|
-
{ dtype: "string" }
|
|
1017
|
-
);
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
}
|
|
1021
|
-
function setTagColumns(out, input) {
|
|
1022
|
-
for (const target of ["node", "edge"]) {
|
|
1023
|
-
const table = target === "node" ? out.nodes : out.edges;
|
|
1024
|
-
for (const [name, col] of input.tags[target]) {
|
|
1025
|
-
const kinds = new Set(col.filter((v) => v !== null).map((v) => typeof v));
|
|
1026
|
-
let dtype = "string";
|
|
1027
|
-
if (kinds.has("number")) {
|
|
1028
|
-
dtype = "f64";
|
|
1029
|
-
} else if (kinds.has("boolean")) {
|
|
1030
|
-
dtype = "bool";
|
|
1031
|
-
}
|
|
1032
|
-
table.set(name, col, { dtype });
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
function dataRead(rules, target) {
|
|
1037
|
-
const out = /* @__PURE__ */ new Set();
|
|
1038
|
-
for (const { ext: _ext, ...rule } of rules.filter((r) => r.target === target)) {
|
|
1039
|
-
JSON.stringify(rule, (_k, v) => {
|
|
1040
|
-
if (typeof v === "object" && v !== null && !Array.isArray(v) && Object.keys(v).length === 1) {
|
|
1041
|
-
const { data } = v;
|
|
1042
|
-
if (typeof data === "string") {
|
|
1043
|
-
out.add(data);
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
return v;
|
|
1047
|
-
});
|
|
1048
|
-
}
|
|
1049
|
-
return out;
|
|
1050
|
-
}
|
|
1051
|
-
const DOT_ATTRIBUTE_CLASH_CODE = "W_DOT_ATTRIBUTE_CLASH";
|
|
1052
|
-
function replacedRows(table, name, written) {
|
|
1053
|
-
const column = table.get(name);
|
|
1054
|
-
let n = 0;
|
|
1055
|
-
for (let i = 0; column !== null && i < column.length; i++) {
|
|
1056
|
-
const cell = column.isSet(i) ? plainCell(column.value(i)) : null;
|
|
1057
|
-
const w = written?.[i] ?? null;
|
|
1058
|
-
const text = typeof cell === "string" ? cell : JSON.stringify(cell);
|
|
1059
|
-
if (cell !== null && (w === null || String(w) !== text)) {
|
|
1060
|
-
n++;
|
|
1061
|
-
}
|
|
1062
|
-
}
|
|
1063
|
-
return n;
|
|
1064
|
-
}
|
|
9
|
+
import { a as DOT_ATTRIBUTE_CLASH_CODE, b as DOT_FORMAT, d as dotStyledExport, D as DOT_STYLE_CAPABILITIES, C as CLUSTER_COLUMN, P as POS_ATTRIBUTE, K as KEY_ATTRIBUTE, L as LABEL_ATTRIBUTE, c as DOT_META_KEY, i as isHtmlString, e as PARENT_COLUMN, T as TARGET_PORT_COLUMN, S as SOURCE_PORT_COLUMN, f as dotStyles, g as DOT_ORIGIN, h as PIN_ATTRIBUTE, j as POSITION_COLUMN } from "./styles-Cm62yyQX.js";
|
|
10
|
+
import { i as importChosenGraph } from "./choose-CczZJaX_.js";
|
|
11
|
+
import { r as readText, b as throwIfAborted, c as canonicalEncoding } from "./input-CAxt_aV-.js";
|
|
12
|
+
import { m as median } from "./convert-Ct2zelbQ.js";
|
|
1065
13
|
const DOT_LOSS = Object.freeze({
|
|
1066
14
|
/**
|
|
1067
15
|
* An id, name or text with a backslash before a quote or a line break, or at its end, cannot be written as a DOT
|
|
@@ -2532,6 +1480,24 @@ const CLUSTER_PREFIX = "cluster";
|
|
|
2532
1480
|
const CLUSTER_ATTRIBUTE = "cluster";
|
|
2533
1481
|
const STATEMENTS_PER_ABORT_CHECK = 64;
|
|
2534
1482
|
const MAX_ANCESTOR_WALK = 4096;
|
|
1483
|
+
const INHERITED_GRAPH_ATTRIBUTES = /* @__PURE__ */ new Set([
|
|
1484
|
+
"bgcolor",
|
|
1485
|
+
"color",
|
|
1486
|
+
"colorscheme",
|
|
1487
|
+
"fillcolor",
|
|
1488
|
+
"fontcolor",
|
|
1489
|
+
"fontname",
|
|
1490
|
+
"fontsize",
|
|
1491
|
+
"gradientangle",
|
|
1492
|
+
"label",
|
|
1493
|
+
"labeljust",
|
|
1494
|
+
"labelloc",
|
|
1495
|
+
"pencolor",
|
|
1496
|
+
"penwidth",
|
|
1497
|
+
"peripheries",
|
|
1498
|
+
"style",
|
|
1499
|
+
"tooltip"
|
|
1500
|
+
]);
|
|
2535
1501
|
const DOT_HEADER = /^\s*(strict\s+)?(di)?graph(?=[\s{"/]|$)(?!\s*\[)/i;
|
|
2536
1502
|
const TRUE_TEXTS = /* @__PURE__ */ new Set(["true", "yes", "1"]);
|
|
2537
1503
|
const COMPASS_POINTS = /* @__PURE__ */ new Set(["n", "ne", "e", "se", "s", "sw", "w", "nw", "c", "_"]);
|
|
@@ -2821,6 +1787,8 @@ class DotParser {
|
|
|
2821
1787
|
this.idOf = /* @__PURE__ */ new Map();
|
|
2822
1788
|
this.containers = /* @__PURE__ */ new Set();
|
|
2823
1789
|
this.parentOf = /* @__PURE__ */ new Map();
|
|
1790
|
+
this.inherited = /* @__PURE__ */ new Map();
|
|
1791
|
+
this.ownAttributes = /* @__PURE__ */ new Map();
|
|
2824
1792
|
this.conflictWarned = /* @__PURE__ */ new Set();
|
|
2825
1793
|
this.strictEdges = /* @__PURE__ */ new Map();
|
|
2826
1794
|
this.keyedEdges = /* @__PURE__ */ new Map();
|
|
@@ -2889,6 +1857,7 @@ class DotParser {
|
|
|
2889
1857
|
});
|
|
2890
1858
|
const root = this.newScope(null, headerLine, true, null);
|
|
2891
1859
|
this.statementList(root);
|
|
1860
|
+
this.applyInherited();
|
|
2892
1861
|
return lexer.next();
|
|
2893
1862
|
}
|
|
2894
1863
|
/**
|
|
@@ -2910,6 +1879,7 @@ class DotParser {
|
|
|
2910
1879
|
memberSet: /* @__PURE__ */ new Set(),
|
|
2911
1880
|
containers: [],
|
|
2912
1881
|
attributes: /* @__PURE__ */ new Map(),
|
|
1882
|
+
graphDefaults: new Map(parent?.graphDefaults),
|
|
2913
1883
|
cluster: false,
|
|
2914
1884
|
container: INVALID_INDEX
|
|
2915
1885
|
};
|
|
@@ -3137,42 +2107,10 @@ class DotParser {
|
|
|
3137
2107
|
*/
|
|
3138
2108
|
closeScope(scope, parent) {
|
|
3139
2109
|
const { container } = scope;
|
|
3140
|
-
if (container
|
|
3141
|
-
|
|
3142
|
-
if (attribute.name !== CLUSTER_ATTRIBUTE) {
|
|
3143
|
-
this.setNodeAttribute(container, attribute.name, attribute.value, attribute.line);
|
|
3144
|
-
}
|
|
3145
|
-
}
|
|
3146
|
-
for (const nested of scope.containers) {
|
|
3147
|
-
if (nested !== container && !this.parentOf.has(nested)) {
|
|
3148
|
-
this.setParent(nested, container);
|
|
3149
|
-
}
|
|
3150
|
-
}
|
|
3151
|
-
for (const member of scope.members) {
|
|
3152
|
-
if (member === container) {
|
|
3153
|
-
continue;
|
|
3154
|
-
}
|
|
3155
|
-
const existing = this.parentOf.get(member);
|
|
3156
|
-
if (existing === void 0) {
|
|
3157
|
-
this.setParent(member, container);
|
|
3158
|
-
} else if (existing !== container && !this.isAncestor(container, existing)) {
|
|
3159
|
-
this.clusterConflict(member, existing, container, scope.line);
|
|
3160
|
-
}
|
|
3161
|
-
}
|
|
3162
|
-
parent.containers.push(container);
|
|
2110
|
+
if (container === INVALID_INDEX) {
|
|
2111
|
+
this.closePlainSubgraph(scope, parent);
|
|
3163
2112
|
} else {
|
|
3164
|
-
|
|
3165
|
-
const names = [...scope.attributes.keys()].join(", ");
|
|
3166
|
-
this.report.warning(
|
|
3167
|
-
"unsupported",
|
|
3168
|
-
DOT_ISSUE.SUBGRAPH_ATTRIBUTES_DROPPED,
|
|
3169
|
-
`subgraph ${scope.name === null ? "(anonymous)" : JSON.stringify(scope.name)} is not a cluster; its attributes (${names}) cannot be represented and were dropped`,
|
|
3170
|
-
{ line: scope.line, element: scope.name }
|
|
3171
|
-
);
|
|
3172
|
-
}
|
|
3173
|
-
for (const nested of scope.containers) {
|
|
3174
|
-
parent.containers.push(nested);
|
|
3175
|
-
}
|
|
2113
|
+
this.closeCluster(scope, parent, container);
|
|
3176
2114
|
}
|
|
3177
2115
|
if (!parent.root) {
|
|
3178
2116
|
for (const member of scope.members) {
|
|
@@ -3183,6 +2121,82 @@ class DotParser {
|
|
|
3183
2121
|
}
|
|
3184
2122
|
}
|
|
3185
2123
|
}
|
|
2124
|
+
/**
|
|
2125
|
+
* Finish a cluster: apply its attributes to its container node, assign parents to its nested
|
|
2126
|
+
* containers and its members, and hand the container to the enclosing scope.
|
|
2127
|
+
* @param scope - the closed scope
|
|
2128
|
+
* @param parent - the enclosing scope
|
|
2129
|
+
* @param container - the cluster's container node
|
|
2130
|
+
*/
|
|
2131
|
+
closeCluster(scope, parent, container) {
|
|
2132
|
+
const own = this.ownAttributes.get(container) ?? /* @__PURE__ */ new Set();
|
|
2133
|
+
this.ownAttributes.set(container, own);
|
|
2134
|
+
for (const attribute of scope.attributes.values()) {
|
|
2135
|
+
if (attribute.name !== CLUSTER_ATTRIBUTE) {
|
|
2136
|
+
own.add(attribute.name);
|
|
2137
|
+
this.setNodeAttribute(container, attribute.name, attribute.value, attribute.line);
|
|
2138
|
+
}
|
|
2139
|
+
}
|
|
2140
|
+
for (const nested of scope.containers) {
|
|
2141
|
+
if (nested !== container && !this.parentOf.has(nested)) {
|
|
2142
|
+
this.setParent(nested, container);
|
|
2143
|
+
}
|
|
2144
|
+
}
|
|
2145
|
+
for (const member of scope.members) {
|
|
2146
|
+
if (member !== container) {
|
|
2147
|
+
this.adoptMember(member, container, scope.line);
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
parent.containers.push(container);
|
|
2151
|
+
}
|
|
2152
|
+
/**
|
|
2153
|
+
* Put a cluster's member in it, unless it is already in another cluster this one is not inside.
|
|
2154
|
+
* @param member - the member node
|
|
2155
|
+
* @param container - the cluster's container node
|
|
2156
|
+
* @param line - the cluster's line
|
|
2157
|
+
*/
|
|
2158
|
+
adoptMember(member, container, line) {
|
|
2159
|
+
const existing = this.parentOf.get(member);
|
|
2160
|
+
if (existing === void 0) {
|
|
2161
|
+
this.setParent(member, container);
|
|
2162
|
+
} else if (existing !== container && !this.isAncestor(container, existing)) {
|
|
2163
|
+
this.clusterConflict(member, existing, container, line);
|
|
2164
|
+
}
|
|
2165
|
+
}
|
|
2166
|
+
/**
|
|
2167
|
+
* Finish a subgraph that is not a cluster: report its attributes dropped, and hand its nested
|
|
2168
|
+
* containers to the enclosing scope.
|
|
2169
|
+
* @param scope - the closed scope
|
|
2170
|
+
* @param parent - the enclosing scope
|
|
2171
|
+
*/
|
|
2172
|
+
closePlainSubgraph(scope, parent) {
|
|
2173
|
+
if (scope.attributes.size > 0) {
|
|
2174
|
+
const names = [...scope.attributes.keys()].join(", ");
|
|
2175
|
+
this.report.warning(
|
|
2176
|
+
"unsupported",
|
|
2177
|
+
DOT_ISSUE.SUBGRAPH_ATTRIBUTES_DROPPED,
|
|
2178
|
+
`subgraph ${scope.name === null ? "(anonymous)" : JSON.stringify(scope.name)} is not a cluster; its attributes (${names}) cannot be represented and were dropped`,
|
|
2179
|
+
{ line: scope.line, element: scope.name }
|
|
2180
|
+
);
|
|
2181
|
+
}
|
|
2182
|
+
for (const nested of scope.containers) {
|
|
2183
|
+
parent.containers.push(nested);
|
|
2184
|
+
}
|
|
2185
|
+
}
|
|
2186
|
+
/**
|
|
2187
|
+
* Give every cluster the drawing attributes it inherits and does not set itself (Graphviz's subgraph attribute
|
|
2188
|
+
* inheritance), once the whole graph is read: a cluster reopened later can still set its own.
|
|
2189
|
+
*/
|
|
2190
|
+
applyInherited() {
|
|
2191
|
+
for (const [container, attributes] of this.inherited) {
|
|
2192
|
+
const own = this.ownAttributes.get(container);
|
|
2193
|
+
for (const attribute of attributes.values()) {
|
|
2194
|
+
if (own?.has(attribute.name) !== true) {
|
|
2195
|
+
this.setNodeAttribute(container, attribute.name, attribute.value, attribute.line);
|
|
2196
|
+
}
|
|
2197
|
+
}
|
|
2198
|
+
}
|
|
2199
|
+
}
|
|
3186
2200
|
/**
|
|
3187
2201
|
* Whether `candidate` is an ancestor of `node` through the parents assigned so far.
|
|
3188
2202
|
* @param candidate - the possible ancestor
|
|
@@ -3264,6 +2278,7 @@ class DotParser {
|
|
|
3264
2278
|
if (!this.containers.has(index)) {
|
|
3265
2279
|
this.containers.add(index);
|
|
3266
2280
|
this.sink.setNodeValue(this.clusterColumn(), index, true);
|
|
2281
|
+
this.inherited.set(index, new Map(scope.graphDefaults));
|
|
3267
2282
|
}
|
|
3268
2283
|
scope.container = index;
|
|
3269
2284
|
} catch (err) {
|
|
@@ -3280,6 +2295,9 @@ class DotParser {
|
|
|
3280
2295
|
* @param attribute - the attribute
|
|
3281
2296
|
*/
|
|
3282
2297
|
scopeAttribute(scope, attribute) {
|
|
2298
|
+
if (INHERITED_GRAPH_ATTRIBUTES.has(attribute.name)) {
|
|
2299
|
+
scope.graphDefaults.set(attribute.name, attribute);
|
|
2300
|
+
}
|
|
3283
2301
|
if (scope.root) {
|
|
3284
2302
|
this.setGraphAttribute(attribute);
|
|
3285
2303
|
return;
|
|
@@ -3986,8 +3004,7 @@ class DotParser {
|
|
|
3986
3004
|
export {
|
|
3987
3005
|
DOT_ISSUE as D,
|
|
3988
3006
|
DOT_LOSS as a,
|
|
3989
|
-
|
|
3990
|
-
dotImporter as c,
|
|
3007
|
+
dotImporter as b,
|
|
3991
3008
|
dotExporter as d
|
|
3992
3009
|
};
|
|
3993
|
-
//# sourceMappingURL=importer-
|
|
3010
|
+
//# sourceMappingURL=importer-DaLTjbds.js.map
|