@graphty/graph-io 0.3.43 → 0.3.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/approximations-3Q4TsdTh.js +40 -0
- package/dist/chunks/approximations-3Q4TsdTh.js.map +1 -0
- package/dist/chunks/block-JQiwViEt.js +2777 -0
- package/dist/chunks/block-JQiwViEt.js.map +1 -0
- package/dist/chunks/{choose-DvpbdRuz.js → choose-BemygfH8.js} +3 -2
- package/dist/chunks/{choose-DvpbdRuz.js.map → choose-BemygfH8.js.map} +1 -1
- package/dist/chunks/{constants-fT3E8JYY.js → constants-BFUR_CtU.js} +6 -2
- package/dist/chunks/constants-BFUR_CtU.js.map +1 -0
- package/dist/chunks/convert-BcQ8_jMo.js +59 -0
- package/dist/chunks/convert-BcQ8_jMo.js.map +1 -0
- package/dist/chunks/emit-DCwFLts5.js +3456 -0
- package/dist/chunks/emit-DCwFLts5.js.map +1 -0
- package/dist/chunks/{escape-B62ZGM_a.js → escape-B1rMftd9.js} +43 -20
- package/dist/chunks/escape-B1rMftd9.js.map +1 -0
- package/dist/chunks/{export-rKLeGQMo.js → export-D7IGzTG4.js} +196 -792
- package/dist/chunks/export-D7IGzTG4.js.map +1 -0
- package/dist/chunks/{exporter-BWwEuOPT.js → exporter-BtnqYuuj.js} +22 -12
- package/dist/chunks/exporter-BtnqYuuj.js.map +1 -0
- package/dist/chunks/{exporter-yLxKBvLE.js → exporter-ChPyhBOv.js} +4 -3
- package/dist/chunks/{exporter-yLxKBvLE.js.map → exporter-ChPyhBOv.js.map} +1 -1
- package/dist/chunks/{exporter-8hLNemFk.js → exporter-KEPxYUXD.js} +133 -74
- package/dist/chunks/exporter-KEPxYUXD.js.map +1 -0
- package/dist/chunks/{exporter-RVtXVetw.js → exporter-quPUCBiC.js} +1805 -287
- package/dist/chunks/exporter-quPUCBiC.js.map +1 -0
- package/dist/chunks/format-GDmO6m6Q.js +676 -0
- package/dist/chunks/format-GDmO6m6Q.js.map +1 -0
- package/dist/chunks/generic-BL06jrJf.js +1347 -0
- package/dist/chunks/generic-BL06jrJf.js.map +1 -0
- package/dist/chunks/{importer-WrGRZb0N.js → importer-B7r2owVf.js} +449 -102
- package/dist/chunks/importer-B7r2owVf.js.map +1 -0
- package/dist/chunks/{importer-Ht7LNg8L.js → importer-BFmOP96W.js} +116 -296
- package/dist/chunks/importer-BFmOP96W.js.map +1 -0
- package/dist/chunks/{importer-BbNb7eNg.js → importer-C2nzGhdV.js} +1390 -129
- package/dist/chunks/importer-C2nzGhdV.js.map +1 -0
- package/dist/chunks/{importer-Dz7tI8Sa.js → importer-CbX2_rNF.js} +617 -115
- package/dist/chunks/importer-CbX2_rNF.js.map +1 -0
- package/dist/chunks/{importer-D794XUTe.js → importer-CdzeN6X4.js} +31 -8
- package/dist/chunks/importer-CdzeN6X4.js.map +1 -0
- package/dist/chunks/{importer-xZ-3suY1.js → importer-ChKNC_GN.js} +791 -135
- package/dist/chunks/importer-ChKNC_GN.js.map +1 -0
- package/dist/chunks/{importer-C98dpSH4.js → importer-dwoYpSqb.js} +141 -82
- package/dist/chunks/importer-dwoYpSqb.js.map +1 -0
- package/dist/chunks/index-B9fdNpTA.js +4310 -0
- package/dist/chunks/index-B9fdNpTA.js.map +1 -0
- package/dist/chunks/{json-elements-DKSqpNW1.js → json-elements-C4FwgnH5.js} +123 -32
- package/dist/chunks/json-elements-C4FwgnH5.js.map +1 -0
- package/dist/chunks/lexicon-B-knUi-l.js +508 -0
- package/dist/chunks/lexicon-B-knUi-l.js.map +1 -0
- package/dist/chunks/{ontology-export-CtRXjg_i.js → ontology-export-BSpbY5FL.js} +3 -2
- package/dist/chunks/{ontology-export-CtRXjg_i.js.map → ontology-export-BSpbY5FL.js.map} +1 -1
- package/dist/chunks/{records-Cu4bxYOm.js → records-Nwz_rbNt.js} +2 -2
- package/dist/chunks/{records-Cu4bxYOm.js.map → records-Nwz_rbNt.js.map} +1 -1
- package/dist/chunks/styles-Brt9JMfs.js +690 -0
- package/dist/chunks/styles-Brt9JMfs.js.map +1 -0
- package/dist/chunks/styles-_N-C8S-U.js +2102 -0
- package/dist/chunks/styles-_N-C8S-U.js.map +1 -0
- package/dist/chunks/styles-yed-DAfcIkf7.js +842 -0
- package/dist/chunks/styles-yed-DAfcIkf7.js.map +1 -0
- package/dist/chunks/{text-DHOJXnED.js → text-CgzMqHQb.js} +2 -2
- package/dist/chunks/{text-DHOJXnED.js.map → text-CgzMqHQb.js.map} +1 -1
- package/dist/chunks/units-XMZFIFe1.js +19 -0
- package/dist/chunks/units-XMZFIFe1.js.map +1 -0
- package/dist/csv.js +5 -4
- package/dist/csv.js.map +1 -1
- package/dist/cx.js +1 -1
- package/dist/cx2.js +2 -2
- package/dist/cys.js +1 -1
- package/dist/dot.js +5 -2
- package/dist/dot.js.map +1 -1
- package/dist/gexf.js +292 -412
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +8 -3031
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +354 -240
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +4 -2
- package/dist/graphml.js.map +1 -1
- package/dist/json.js +1 -1
- package/dist/neo4j.js +4 -3
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +4 -2
- package/dist/positions.d.ts +1 -0
- package/dist/positions.js +427 -0
- package/dist/positions.js.map +1 -0
- package/dist/src/common/codes.d.ts +6 -0
- package/dist/src/common/codes.d.ts.map +1 -1
- package/dist/src/common/codes.js +6 -0
- package/dist/src/common/codes.js.map +1 -1
- package/dist/src/common/escape.d.ts.map +1 -1
- package/dist/src/common/escape.js +4 -2
- package/dist/src/common/escape.js.map +1 -1
- package/dist/src/common/export.d.ts +10 -0
- package/dist/src/common/export.d.ts.map +1 -1
- package/dist/src/common/export.js +123 -100
- package/dist/src/common/export.js.map +1 -1
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +8 -1
- package/dist/src/common/input.js.map +1 -1
- package/dist/src/common/json-elements.d.ts +12 -9
- package/dist/src/common/json-elements.d.ts.map +1 -1
- package/dist/src/common/json-elements.js +160 -37
- package/dist/src/common/json-elements.js.map +1 -1
- package/dist/src/common/notes.d.ts +42 -0
- package/dist/src/common/notes.d.ts.map +1 -0
- package/dist/src/common/notes.js +72 -0
- package/dist/src/common/notes.js.map +1 -0
- package/dist/src/common/report.d.ts +18 -0
- package/dist/src/common/report.d.ts.map +1 -1
- package/dist/src/common/report.js +36 -1
- package/dist/src/common/report.js.map +1 -1
- package/dist/src/common/units.d.ts +24 -0
- package/dist/src/common/units.d.ts.map +1 -0
- package/dist/src/common/units.js +26 -0
- package/dist/src/common/units.js.map +1 -0
- package/dist/src/common/xml.d.ts +18 -0
- package/dist/src/common/xml.d.ts.map +1 -1
- package/dist/src/common/xml.js +42 -5
- package/dist/src/common/xml.js.map +1 -1
- package/dist/src/formats/cx/exporter.d.ts +6 -0
- package/dist/src/formats/cx/exporter.d.ts.map +1 -1
- package/dist/src/formats/cx/exporter.js +71 -8
- package/dist/src/formats/cx/exporter.js.map +1 -1
- package/dist/src/formats/cx/importer.d.ts +5 -2
- package/dist/src/formats/cx/importer.d.ts.map +1 -1
- package/dist/src/formats/cx/importer.js +102 -72
- package/dist/src/formats/cx/importer.js.map +1 -1
- package/dist/src/formats/cx/styles.d.ts +102 -0
- package/dist/src/formats/cx/styles.d.ts.map +1 -0
- package/dist/src/formats/cx/styles.js +225 -0
- package/dist/src/formats/cx/styles.js.map +1 -0
- package/dist/src/formats/cx2/exporter.d.ts +5 -0
- package/dist/src/formats/cx2/exporter.d.ts.map +1 -1
- package/dist/src/formats/cx2/exporter.js +181 -71
- package/dist/src/formats/cx2/exporter.js.map +1 -1
- package/dist/src/formats/cx2/importer.d.ts +4 -1
- package/dist/src/formats/cx2/importer.d.ts.map +1 -1
- package/dist/src/formats/cx2/importer.js +19 -1
- package/dist/src/formats/cx2/importer.js.map +1 -1
- package/dist/src/formats/cx2/styles.d.ts +18 -0
- package/dist/src/formats/cx2/styles.d.ts.map +1 -0
- package/dist/src/formats/cx2/styles.js +24 -0
- package/dist/src/formats/cx2/styles.js.map +1 -0
- package/dist/src/formats/cys/constants.d.ts +2 -0
- package/dist/src/formats/cys/constants.d.ts.map +1 -1
- package/dist/src/formats/cys/constants.js +2 -0
- package/dist/src/formats/cys/constants.js.map +1 -1
- package/dist/src/formats/cys/exporter.d.ts +6 -2
- package/dist/src/formats/cys/exporter.d.ts.map +1 -1
- package/dist/src/formats/cys/exporter.js +215 -53
- package/dist/src/formats/cys/exporter.js.map +1 -1
- package/dist/src/formats/cys/importer.d.ts +2 -1
- package/dist/src/formats/cys/importer.d.ts.map +1 -1
- package/dist/src/formats/cys/importer.js +119 -6
- package/dist/src/formats/cys/importer.js.map +1 -1
- package/dist/src/formats/cys/session.d.ts +2 -0
- package/dist/src/formats/cys/session.d.ts.map +1 -1
- package/dist/src/formats/cys/session.js +5 -0
- package/dist/src/formats/cys/session.js.map +1 -1
- package/dist/src/formats/cys/styles.d.ts +38 -0
- package/dist/src/formats/cys/styles.d.ts.map +1 -0
- package/dist/src/formats/cys/styles.js +213 -0
- package/dist/src/formats/cys/styles.js.map +1 -0
- package/dist/src/formats/cys/tables.d.ts +8 -3
- package/dist/src/formats/cys/tables.d.ts.map +1 -1
- package/dist/src/formats/cys/tables.js +88 -34
- package/dist/src/formats/cys/tables.js.map +1 -1
- package/dist/src/formats/dot/exporter.d.ts +2 -0
- package/dist/src/formats/dot/exporter.d.ts.map +1 -1
- package/dist/src/formats/dot/exporter.js +195 -81
- package/dist/src/formats/dot/exporter.js.map +1 -1
- package/dist/src/formats/dot/importer.d.ts.map +1 -1
- package/dist/src/formats/dot/importer.js +100 -20
- package/dist/src/formats/dot/importer.js.map +1 -1
- package/dist/src/formats/dot/index.d.ts +1 -0
- package/dist/src/formats/dot/index.d.ts.map +1 -1
- package/dist/src/formats/dot/index.js +1 -0
- package/dist/src/formats/dot/index.js.map +1 -1
- package/dist/src/formats/dot/positions.d.ts +14 -0
- package/dist/src/formats/dot/positions.d.ts.map +1 -0
- package/dist/src/formats/dot/positions.js +70 -0
- package/dist/src/formats/dot/positions.js.map +1 -0
- package/dist/src/formats/dot/styles.d.ts +82 -0
- package/dist/src/formats/dot/styles.d.ts.map +1 -0
- package/dist/src/formats/dot/styles.js +1484 -0
- package/dist/src/formats/dot/styles.js.map +1 -0
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
- package/dist/src/formats/gexf/exporter.js +20 -5
- package/dist/src/formats/gexf/exporter.js.map +1 -1
- package/dist/src/formats/gexf/importer.d.ts +8 -1
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +251 -131
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gexf/index.d.ts +8 -0
- package/dist/src/formats/gexf/index.d.ts.map +1 -1
- package/dist/src/formats/gexf/index.js +10 -2
- package/dist/src/formats/gexf/index.js.map +1 -1
- package/dist/src/formats/gexf/schema.d.ts +5 -0
- package/dist/src/formats/gexf/schema.d.ts.map +1 -1
- package/dist/src/formats/gexf/schema.js +5 -0
- package/dist/src/formats/gexf/schema.js.map +1 -1
- package/dist/src/formats/gexf/styles.d.ts +74 -0
- package/dist/src/formats/gexf/styles.d.ts.map +1 -0
- package/dist/src/formats/gexf/styles.js +604 -0
- package/dist/src/formats/gexf/styles.js.map +1 -0
- package/dist/src/formats/gml/exporter.d.ts +1 -5
- package/dist/src/formats/gml/exporter.d.ts.map +1 -1
- package/dist/src/formats/gml/exporter.js +19 -8
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/gml/importer.d.ts.map +1 -1
- package/dist/src/formats/gml/importer.js +4 -0
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/index.d.ts +2 -1
- package/dist/src/formats/gml/index.d.ts.map +1 -1
- package/dist/src/formats/gml/index.js +2 -1
- package/dist/src/formats/gml/index.js.map +1 -1
- package/dist/src/formats/gml/positions.d.ts +14 -0
- package/dist/src/formats/gml/positions.d.ts.map +1 -0
- package/dist/src/formats/gml/positions.js +46 -0
- package/dist/src/formats/gml/positions.js.map +1 -0
- package/dist/src/formats/gml/styles.d.ts +59 -0
- package/dist/src/formats/gml/styles.d.ts.map +1 -0
- package/dist/src/formats/gml/styles.js +1056 -0
- package/dist/src/formats/gml/styles.js.map +1 -0
- package/dist/src/formats/gml/syntax.d.ts +11 -0
- package/dist/src/formats/gml/syntax.d.ts.map +1 -1
- package/dist/src/formats/gml/syntax.js +151 -62
- package/dist/src/formats/gml/syntax.js.map +1 -1
- package/dist/src/formats/graphml/constants.d.ts +4 -0
- package/dist/src/formats/graphml/constants.d.ts.map +1 -1
- package/dist/src/formats/graphml/constants.js +5 -1
- package/dist/src/formats/graphml/constants.js.map +1 -1
- package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
- package/dist/src/formats/graphml/exporter.js +133 -65
- package/dist/src/formats/graphml/exporter.js.map +1 -1
- package/dist/src/formats/graphml/importer.d.ts +4 -1
- package/dist/src/formats/graphml/importer.d.ts.map +1 -1
- package/dist/src/formats/graphml/importer.js +100 -44
- package/dist/src/formats/graphml/importer.js.map +1 -1
- package/dist/src/formats/graphml/index.d.ts +1 -0
- package/dist/src/formats/graphml/index.d.ts.map +1 -1
- package/dist/src/formats/graphml/index.js +1 -0
- package/dist/src/formats/graphml/index.js.map +1 -1
- package/dist/src/formats/graphml/styles-plain.d.ts +19 -0
- package/dist/src/formats/graphml/styles-plain.d.ts.map +1 -0
- package/dist/src/formats/graphml/styles-plain.js +187 -0
- package/dist/src/formats/graphml/styles-plain.js.map +1 -0
- package/dist/src/formats/graphml/styles-yed.d.ts +179 -0
- package/dist/src/formats/graphml/styles-yed.d.ts.map +1 -0
- package/dist/src/formats/graphml/styles-yed.js +1086 -0
- package/dist/src/formats/graphml/styles-yed.js.map +1 -0
- package/dist/src/formats/graphml/styles-yfiles3.d.ts +19 -0
- package/dist/src/formats/graphml/styles-yfiles3.d.ts.map +1 -0
- package/dist/src/formats/graphml/styles-yfiles3.js +508 -0
- package/dist/src/formats/graphml/styles-yfiles3.js.map +1 -0
- package/dist/src/formats/graphml/tree.d.ts.map +1 -1
- package/dist/src/formats/graphml/tree.js +34 -19
- package/dist/src/formats/graphml/tree.js.map +1 -1
- package/dist/src/formats/graphml/yfiles.d.ts +16 -2
- package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
- package/dist/src/formats/graphml/yfiles.js +83 -12
- package/dist/src/formats/graphml/yfiles.js.map +1 -1
- package/dist/src/formats/json/exporter.d.ts +5 -0
- package/dist/src/formats/json/exporter.d.ts.map +1 -1
- package/dist/src/formats/json/exporter.js +68 -25
- package/dist/src/formats/json/exporter.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts +22 -3
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +439 -264
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/positions.d.ts +16 -0
- package/dist/src/formats/json/positions.d.ts.map +1 -0
- package/dist/src/formats/json/positions.js +44 -0
- package/dist/src/formats/json/positions.js.map +1 -0
- package/dist/src/formats/json/styles.d.ts +102 -0
- package/dist/src/formats/json/styles.d.ts.map +1 -0
- package/dist/src/formats/json/styles.js +1753 -0
- package/dist/src/formats/json/styles.js.map +1 -0
- package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
- package/dist/src/formats/neo4j/exporter.js +2 -1
- package/dist/src/formats/neo4j/exporter.js.map +1 -1
- package/dist/src/formats/pajek/exporter.d.ts +2 -0
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +142 -76
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.d.ts +4 -0
- package/dist/src/formats/pajek/importer.d.ts.map +1 -1
- package/dist/src/formats/pajek/importer.js +60 -6
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/index.d.ts +2 -0
- package/dist/src/formats/pajek/index.d.ts.map +1 -1
- package/dist/src/formats/pajek/index.js +2 -0
- package/dist/src/formats/pajek/index.js.map +1 -1
- package/dist/src/formats/pajek/styles.d.ts +50 -0
- package/dist/src/formats/pajek/styles.d.ts.map +1 -0
- package/dist/src/formats/pajek/styles.js +569 -0
- package/dist/src/formats/pajek/styles.js.map +1 -0
- package/dist/src/formats/pajek/syntax.d.ts +6 -0
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +6 -0
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/columns.d.ts.map +1 -1
- package/dist/src/formats/xgmml/columns.js +34 -9
- package/dist/src/formats/xgmml/columns.js.map +1 -1
- package/dist/src/formats/xgmml/constants.d.ts +2 -0
- package/dist/src/formats/xgmml/constants.d.ts.map +1 -1
- package/dist/src/formats/xgmml/constants.js +3 -1
- package/dist/src/formats/xgmml/constants.js.map +1 -1
- package/dist/src/formats/xgmml/document.d.ts +12 -8
- package/dist/src/formats/xgmml/document.d.ts.map +1 -1
- package/dist/src/formats/xgmml/document.js +56 -13
- package/dist/src/formats/xgmml/document.js.map +1 -1
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
- package/dist/src/formats/xgmml/emit.js +12 -6
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/exporter.d.ts +3 -1
- package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
- package/dist/src/formats/xgmml/exporter.js +22 -9
- package/dist/src/formats/xgmml/exporter.js.map +1 -1
- package/dist/src/formats/xgmml/importer.d.ts +2 -1
- package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
- package/dist/src/formats/xgmml/importer.js +31 -24
- package/dist/src/formats/xgmml/importer.js.map +1 -1
- package/dist/src/formats/xgmml/styles.d.ts +104 -0
- package/dist/src/formats/xgmml/styles.d.ts.map +1 -0
- package/dist/src/formats/xgmml/styles.js +310 -0
- package/dist/src/formats/xgmml/styles.js.map +1 -0
- package/dist/src/index.d.ts +9 -7
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +7 -7
- package/dist/src/index.js.map +1 -1
- package/dist/src/positions/codes.d.ts +31 -0
- package/dist/src/positions/codes.d.ts.map +1 -0
- package/dist/src/positions/codes.js +26 -0
- package/dist/src/positions/codes.js.map +1 -0
- package/dist/src/positions/convert.d.ts +58 -0
- package/dist/src/positions/convert.d.ts.map +1 -0
- package/dist/src/positions/convert.js +107 -0
- package/dist/src/positions/convert.js.map +1 -0
- package/dist/src/positions/extract.d.ts +27 -0
- package/dist/src/positions/extract.d.ts.map +1 -0
- package/dist/src/positions/extract.js +526 -0
- package/dist/src/positions/extract.js.map +1 -0
- package/dist/src/positions/index.d.ts +10 -0
- package/dist/src/positions/index.d.ts.map +1 -0
- package/dist/src/positions/index.js +9 -0
- package/dist/src/positions/index.js.map +1 -0
- package/dist/src/positions/types.d.ts +208 -0
- package/dist/src/positions/types.d.ts.map +1 -0
- package/dist/src/positions/types.js +10 -0
- package/dist/src/positions/types.js.map +1 -0
- package/dist/src/registry.d.ts +30 -0
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +130 -9
- package/dist/src/registry.js.map +1 -1
- package/dist/src/styles/annotations.d.ts +132 -0
- package/dist/src/styles/annotations.d.ts.map +1 -0
- package/dist/src/styles/annotations.js +320 -0
- package/dist/src/styles/annotations.js.map +1 -0
- package/dist/src/styles/budget.d.ts +45 -0
- package/dist/src/styles/budget.d.ts.map +1 -0
- package/dist/src/styles/budget.js +58 -0
- package/dist/src/styles/budget.js.map +1 -0
- package/dist/src/styles/canon/bends.d.ts +32 -0
- package/dist/src/styles/canon/bends.d.ts.map +1 -0
- package/dist/src/styles/canon/bends.js +74 -0
- package/dist/src/styles/canon/bends.js.map +1 -0
- package/dist/src/styles/canon/color-tables.d.ts +22 -0
- package/dist/src/styles/canon/color-tables.d.ts.map +1 -0
- package/dist/src/styles/canon/color-tables.js +369 -0
- package/dist/src/styles/canon/color-tables.js.map +1 -0
- package/dist/src/styles/canon/color.d.ts +66 -0
- package/dist/src/styles/canon/color.d.ts.map +1 -0
- package/dist/src/styles/canon/color.js +548 -0
- package/dist/src/styles/canon/color.js.map +1 -0
- package/dist/src/styles/canon/enums.d.ts +25 -0
- package/dist/src/styles/canon/enums.d.ts.map +1 -0
- package/dist/src/styles/canon/enums.js +187 -0
- package/dist/src/styles/canon/enums.js.map +1 -0
- package/dist/src/styles/canon/graphviz.d.ts +48 -0
- package/dist/src/styles/canon/graphviz.d.ts.map +1 -0
- package/dist/src/styles/canon/graphviz.js +160 -0
- package/dist/src/styles/canon/graphviz.js.map +1 -0
- package/dist/src/styles/canon/index.d.ts +13 -0
- package/dist/src/styles/canon/index.d.ts.map +1 -0
- package/dist/src/styles/canon/index.js +13 -0
- package/dist/src/styles/canon/index.js.map +1 -0
- package/dist/src/styles/canon/number.d.ts +59 -0
- package/dist/src/styles/canon/number.d.ts.map +1 -0
- package/dist/src/styles/canon/number.js +142 -0
- package/dist/src/styles/canon/number.js.map +1 -0
- package/dist/src/styles/canon/site.d.ts +51 -0
- package/dist/src/styles/canon/site.d.ts.map +1 -0
- package/dist/src/styles/canon/site.js +63 -0
- package/dist/src/styles/canon/site.js.map +1 -0
- package/dist/src/styles/canon/text.d.ts +61 -0
- package/dist/src/styles/canon/text.d.ts.map +1 -0
- package/dist/src/styles/canon/text.js +199 -0
- package/dist/src/styles/canon/text.js.map +1 -0
- package/dist/src/styles/codes.d.ts +95 -0
- package/dist/src/styles/codes.d.ts.map +1 -0
- package/dist/src/styles/codes.js +97 -0
- package/dist/src/styles/codes.js.map +1 -0
- package/dist/src/styles/cyjs/cascade.d.ts +134 -0
- package/dist/src/styles/cyjs/cascade.d.ts.map +1 -0
- package/dist/src/styles/cyjs/cascade.js +2252 -0
- package/dist/src/styles/cyjs/cascade.js.map +1 -0
- package/dist/src/styles/cyjs/defaults-table.d.ts +25 -0
- package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -0
- package/dist/src/styles/cyjs/defaults-table.js +76 -0
- package/dist/src/styles/cyjs/defaults-table.js.map +1 -0
- package/dist/src/styles/cyjs/emit.d.ts +82 -0
- package/dist/src/styles/cyjs/emit.d.ts.map +1 -0
- package/dist/src/styles/cyjs/emit.js +790 -0
- package/dist/src/styles/cyjs/emit.js.map +1 -0
- package/dist/src/styles/cyjs/index.d.ts +13 -0
- package/dist/src/styles/cyjs/index.d.ts.map +1 -0
- package/dist/src/styles/cyjs/index.js +13 -0
- package/dist/src/styles/cyjs/index.js.map +1 -0
- package/dist/src/styles/cyjs/live.d.ts +46 -0
- package/dist/src/styles/cyjs/live.d.ts.map +1 -0
- package/dist/src/styles/cyjs/live.js +108 -0
- package/dist/src/styles/cyjs/live.js.map +1 -0
- package/dist/src/styles/cyjs/mappers.d.ts +147 -0
- package/dist/src/styles/cyjs/mappers.d.ts.map +1 -0
- package/dist/src/styles/cyjs/mappers.js +744 -0
- package/dist/src/styles/cyjs/mappers.js.map +1 -0
- package/dist/src/styles/cyjs/selector.d.ts +113 -0
- package/dist/src/styles/cyjs/selector.d.ts.map +1 -0
- package/dist/src/styles/cyjs/selector.js +611 -0
- package/dist/src/styles/cyjs/selector.js.map +1 -0
- package/dist/src/styles/cyjs/stylesheet-text.d.ts +37 -0
- package/dist/src/styles/cyjs/stylesheet-text.d.ts.map +1 -0
- package/dist/src/styles/cyjs/stylesheet-text.js +181 -0
- package/dist/src/styles/cyjs/stylesheet-text.js.map +1 -0
- package/dist/src/styles/cytoscape/emit.d.ts +125 -0
- package/dist/src/styles/cytoscape/emit.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/emit.js +1025 -0
- package/dist/src/styles/cytoscape/emit.js.map +1 -0
- package/dist/src/styles/cytoscape/index.d.ts +10 -0
- package/dist/src/styles/cytoscape/index.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/index.js +10 -0
- package/dist/src/styles/cytoscape/index.js.map +1 -0
- package/dist/src/styles/cytoscape/lexicon.d.ts +49 -0
- package/dist/src/styles/cytoscape/lexicon.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/lexicon.js +603 -0
- package/dist/src/styles/cytoscape/lexicon.js.map +1 -0
- package/dist/src/styles/cytoscape/mappings.d.ts +171 -0
- package/dist/src/styles/cytoscape/mappings.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/mappings.js +460 -0
- package/dist/src/styles/cytoscape/mappings.js.map +1 -0
- package/dist/src/styles/cytoscape/resolve.d.ts +137 -0
- package/dist/src/styles/cytoscape/resolve.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/resolve.js +381 -0
- package/dist/src/styles/cytoscape/resolve.js.map +1 -0
- package/dist/src/styles/cytoscape/translate.d.ts +50 -0
- package/dist/src/styles/cytoscape/translate.d.ts.map +1 -0
- package/dist/src/styles/cytoscape/translate.js +156 -0
- package/dist/src/styles/cytoscape/translate.js.map +1 -0
- package/dist/src/styles/defaults.d.ts +90 -0
- package/dist/src/styles/defaults.d.ts.map +1 -0
- package/dist/src/styles/defaults.js +414 -0
- package/dist/src/styles/defaults.js.map +1 -0
- package/dist/src/styles/index.d.ts +15 -0
- package/dist/src/styles/index.d.ts.map +1 -0
- package/dist/src/styles/index.js +14 -0
- package/dist/src/styles/index.js.map +1 -0
- package/dist/src/styles/internal.d.ts +17 -0
- package/dist/src/styles/internal.d.ts.map +1 -0
- package/dist/src/styles/internal.js +16 -0
- package/dist/src/styles/internal.js.map +1 -0
- package/dist/src/styles/io/approximations.d.ts +24 -0
- package/dist/src/styles/io/approximations.d.ts.map +1 -0
- package/dist/src/styles/io/approximations.js +51 -0
- package/dist/src/styles/io/approximations.js.map +1 -0
- package/dist/src/styles/io/block.d.ts +166 -0
- package/dist/src/styles/io/block.d.ts.map +1 -0
- package/dist/src/styles/io/block.js +930 -0
- package/dist/src/styles/io/block.js.map +1 -0
- package/dist/src/styles/io/generic.d.ts +88 -0
- package/dist/src/styles/io/generic.d.ts.map +1 -0
- package/dist/src/styles/io/generic.js +516 -0
- package/dist/src/styles/io/generic.js.map +1 -0
- package/dist/src/styles/io/index.d.ts +8 -0
- package/dist/src/styles/io/index.d.ts.map +1 -0
- package/dist/src/styles/io/index.js +7 -0
- package/dist/src/styles/io/index.js.map +1 -0
- package/dist/src/styles/io/writer.d.ts +80 -0
- package/dist/src/styles/io/writer.d.ts.map +1 -0
- package/dist/src/styles/io/writer.js +596 -0
- package/dist/src/styles/io/writer.js.map +1 -0
- package/dist/src/styles/notes.d.ts +47 -0
- package/dist/src/styles/notes.d.ts.map +1 -0
- package/dist/src/styles/notes.js +140 -0
- package/dist/src/styles/notes.js.map +1 -0
- package/dist/src/styles/plan/classes.d.ts +31 -0
- package/dist/src/styles/plan/classes.d.ts.map +1 -0
- package/dist/src/styles/plan/classes.js +139 -0
- package/dist/src/styles/plan/classes.js.map +1 -0
- package/dist/src/styles/plan/continuous.d.ts +32 -0
- package/dist/src/styles/plan/continuous.d.ts.map +1 -0
- package/dist/src/styles/plan/continuous.js +165 -0
- package/dist/src/styles/plan/continuous.js.map +1 -0
- package/dist/src/styles/plan/discrete.d.ts +39 -0
- package/dist/src/styles/plan/discrete.d.ts.map +1 -0
- package/dist/src/styles/plan/discrete.js +127 -0
- package/dist/src/styles/plan/discrete.js.map +1 -0
- package/dist/src/styles/plan/families.d.ts +31 -0
- package/dist/src/styles/plan/families.d.ts.map +1 -0
- package/dist/src/styles/plan/families.js +95 -0
- package/dist/src/styles/plan/families.js.map +1 -0
- package/dist/src/styles/plan/features.d.ts +58 -0
- package/dist/src/styles/plan/features.d.ts.map +1 -0
- package/dist/src/styles/plan/features.js +185 -0
- package/dist/src/styles/plan/features.js.map +1 -0
- package/dist/src/styles/plan/index.d.ts +7 -0
- package/dist/src/styles/plan/index.d.ts.map +1 -0
- package/dist/src/styles/plan/index.js +7 -0
- package/dist/src/styles/plan/index.js.map +1 -0
- package/dist/src/styles/plan/plan.d.ts +71 -0
- package/dist/src/styles/plan/plan.d.ts.map +1 -0
- package/dist/src/styles/plan/plan.js +893 -0
- package/dist/src/styles/plan/plan.js.map +1 -0
- package/dist/src/styles/plan/resolve.d.ts +137 -0
- package/dist/src/styles/plan/resolve.d.ts.map +1 -0
- package/dist/src/styles/plan/resolve.js +587 -0
- package/dist/src/styles/plan/resolve.js.map +1 -0
- package/dist/src/styles/types.d.ts +702 -0
- package/dist/src/styles/types.d.ts.map +1 -0
- package/dist/src/styles/types.js +10 -0
- package/dist/src/styles/types.js.map +1 -0
- package/dist/src/styles/vocabulary.d.ts +41 -0
- package/dist/src/styles/vocabulary.d.ts.map +1 -0
- package/dist/src/styles/vocabulary.js +140 -0
- package/dist/src/styles/vocabulary.js.map +1 -0
- package/dist/src/types.d.ts +64 -1
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/types.js.map +1 -1
- package/dist/styles.d.ts +1 -0
- package/dist/styles.js +322 -0
- package/dist/styles.js.map +1 -0
- package/dist/xgmml.js +5 -4
- package/dist/xgmml.js.map +1 -1
- package/package.json +13 -2
- package/src/common/codes.ts +7 -0
- package/src/common/escape.ts +5 -2
- package/src/common/export.ts +179 -140
- package/src/common/input.ts +8 -4
- package/src/common/json-elements.ts +169 -38
- package/src/common/notes.ts +94 -0
- package/src/common/report.ts +41 -1
- package/src/common/units.ts +42 -0
- package/src/common/xml.ts +45 -5
- package/src/formats/cx/exporter.ts +95 -11
- package/src/formats/cx/importer.ts +126 -90
- package/src/formats/cx/styles.ts +304 -0
- package/src/formats/cx2/exporter.ts +234 -77
- package/src/formats/cx2/importer.ts +19 -1
- package/src/formats/cx2/styles.ts +29 -0
- package/src/formats/cys/constants.ts +3 -0
- package/src/formats/cys/exporter.ts +246 -60
- package/src/formats/cys/importer.ts +125 -9
- package/src/formats/cys/session.ts +6 -0
- package/src/formats/cys/styles.ts +254 -0
- package/src/formats/cys/tables.ts +117 -48
- package/src/formats/dot/exporter.ts +262 -126
- package/src/formats/dot/importer.ts +111 -20
- package/src/formats/dot/index.ts +1 -0
- package/src/formats/dot/positions.ts +77 -0
- package/src/formats/dot/styles.ts +1741 -0
- package/src/formats/gexf/exporter.ts +27 -11
- package/src/formats/gexf/importer.ts +308 -158
- package/src/formats/gexf/index.ts +10 -0
- package/src/formats/gexf/schema.ts +5 -0
- package/src/formats/gexf/styles.ts +719 -0
- package/src/formats/gml/exporter.ts +33 -14
- package/src/formats/gml/importer.ts +4 -0
- package/src/formats/gml/index.ts +2 -1
- package/src/formats/gml/positions.ts +52 -0
- package/src/formats/gml/styles.ts +1248 -0
- package/src/formats/gml/syntax.ts +173 -62
- package/src/formats/graphml/constants.ts +5 -0
- package/src/formats/graphml/exporter.ts +163 -71
- package/src/formats/graphml/importer.ts +119 -45
- package/src/formats/graphml/index.ts +1 -0
- package/src/formats/graphml/styles-plain.ts +236 -0
- package/src/formats/graphml/styles-yed.ts +1221 -0
- package/src/formats/graphml/styles-yfiles3.ts +573 -0
- package/src/formats/graphml/tree.ts +36 -20
- package/src/formats/graphml/yfiles.ts +89 -13
- package/src/formats/json/exporter.ts +76 -26
- package/src/formats/json/importer.ts +541 -322
- package/src/formats/json/positions.ts +50 -0
- package/src/formats/json/styles.ts +2082 -0
- package/src/formats/neo4j/exporter.ts +2 -1
- package/src/formats/pajek/exporter.ts +195 -106
- package/src/formats/pajek/importer.ts +78 -9
- package/src/formats/pajek/index.ts +2 -0
- package/src/formats/pajek/styles.ts +685 -0
- package/src/formats/pajek/syntax.ts +7 -0
- package/src/formats/xgmml/columns.ts +39 -9
- package/src/formats/xgmml/constants.ts +3 -0
- package/src/formats/xgmml/document.ts +54 -12
- package/src/formats/xgmml/emit.ts +11 -6
- package/src/formats/xgmml/exporter.ts +32 -13
- package/src/formats/xgmml/importer.ts +43 -29
- package/src/formats/xgmml/styles.ts +400 -0
- package/src/index.ts +16 -0
- package/src/positions/codes.ts +32 -0
- package/src/positions/convert.ts +123 -0
- package/src/positions/extract.ts +619 -0
- package/src/positions/index.ts +23 -0
- package/src/positions/types.ts +221 -0
- package/src/registry.ts +179 -8
- package/src/styles/annotations.ts +478 -0
- package/src/styles/budget.ts +60 -0
- package/src/styles/canon/bends.ts +84 -0
- package/src/styles/canon/color-tables.ts +386 -0
- package/src/styles/canon/color.ts +624 -0
- package/src/styles/canon/enums.ts +211 -0
- package/src/styles/canon/graphviz.ts +189 -0
- package/src/styles/canon/index.ts +13 -0
- package/src/styles/canon/number.ts +152 -0
- package/src/styles/canon/site.ts +87 -0
- package/src/styles/canon/text.ts +221 -0
- package/src/styles/codes.ts +104 -0
- package/src/styles/cyjs/cascade.ts +2670 -0
- package/src/styles/cyjs/defaults-table.ts +82 -0
- package/src/styles/cyjs/emit.ts +951 -0
- package/src/styles/cyjs/index.ts +37 -0
- package/src/styles/cyjs/live.ts +147 -0
- package/src/styles/cyjs/mappers.ts +879 -0
- package/src/styles/cyjs/selector.ts +778 -0
- package/src/styles/cyjs/stylesheet-text.ts +214 -0
- package/src/styles/cytoscape/emit.ts +1264 -0
- package/src/styles/cytoscape/index.ts +40 -0
- package/src/styles/cytoscape/lexicon.ts +656 -0
- package/src/styles/cytoscape/mappings.ts +603 -0
- package/src/styles/cytoscape/resolve.ts +521 -0
- package/src/styles/cytoscape/translate.ts +237 -0
- package/src/styles/defaults.ts +504 -0
- package/src/styles/index.ts +57 -0
- package/src/styles/internal.ts +17 -0
- package/src/styles/io/approximations.ts +47 -0
- package/src/styles/io/block.ts +1138 -0
- package/src/styles/io/generic.ts +687 -0
- package/src/styles/io/index.ts +18 -0
- package/src/styles/io/writer.ts +745 -0
- package/src/styles/notes.ts +165 -0
- package/src/styles/plan/classes.ts +166 -0
- package/src/styles/plan/continuous.ts +218 -0
- package/src/styles/plan/discrete.ts +165 -0
- package/src/styles/plan/families.ts +115 -0
- package/src/styles/plan/features.ts +234 -0
- package/src/styles/plan/index.ts +7 -0
- package/src/styles/plan/plan.ts +1129 -0
- package/src/styles/plan/resolve.ts +685 -0
- package/src/styles/types.ts +814 -0
- package/src/styles/vocabulary.ts +172 -0
- package/src/types.ts +76 -1
- package/dist/chunks/constants-fT3E8JYY.js.map +0 -1
- package/dist/chunks/escape-B62ZGM_a.js.map +0 -1
- package/dist/chunks/export-rKLeGQMo.js.map +0 -1
- package/dist/chunks/exporter-8hLNemFk.js.map +0 -1
- package/dist/chunks/exporter-BWwEuOPT.js.map +0 -1
- package/dist/chunks/exporter-RVtXVetw.js.map +0 -1
- package/dist/chunks/importer-BbNb7eNg.js.map +0 -1
- package/dist/chunks/importer-C98dpSH4.js.map +0 -1
- package/dist/chunks/importer-D794XUTe.js.map +0 -1
- package/dist/chunks/importer-Dz7tI8Sa.js.map +0 -1
- package/dist/chunks/importer-Ht7LNg8L.js.map +0 -1
- package/dist/chunks/importer-WrGRZb0N.js.map +0 -1
- package/dist/chunks/importer-xZ-3suY1.js.map +0 -1
- package/dist/chunks/json-elements-DKSqpNW1.js.map +0 -1
|
@@ -0,0 +1,548 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical colors: lowercase `#rrggbb` plus an alpha from 0 to 1, read in the namespace of the file's dialect. The
|
|
3
|
+
* alpha never stays in the color: `colorOpacity()` moves it into the property's opacity or drops it with a note.
|
|
4
|
+
*/
|
|
5
|
+
import { STYLE_ISSUE } from "../codes.js";
|
|
6
|
+
import { CSS_COLORS, DVIPS_COLORS, JAVA_COLORS } from "./color-tables.js";
|
|
7
|
+
import { graphvizColor } from "./graphviz.js";
|
|
8
|
+
import { num6 } from "./number.js";
|
|
9
|
+
import { noteAt, scalarText, spendAt } from "./site.js";
|
|
10
|
+
/**
|
|
11
|
+
* A byte as two hex digits, clamped and rounded.
|
|
12
|
+
* @param v - a channel 0..255
|
|
13
|
+
* @returns two lowercase hex digits
|
|
14
|
+
*/
|
|
15
|
+
function hex2(v) {
|
|
16
|
+
return Math.max(0, Math.min(255, Math.round(v)))
|
|
17
|
+
.toString(16)
|
|
18
|
+
.padStart(2, "0");
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* `#rrggbb` from channels 0..255.
|
|
22
|
+
* @param r - red
|
|
23
|
+
* @param g - green
|
|
24
|
+
* @param b - blue
|
|
25
|
+
* @returns the color
|
|
26
|
+
*/
|
|
27
|
+
function rgbHex(r, g, b) {
|
|
28
|
+
return `#${hex2(r)}${hex2(g)}${hex2(b)}`;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* An alpha clamped to 0..1 at 6 significant digits.
|
|
32
|
+
* @param a - the alpha
|
|
33
|
+
* @returns the canonical alpha
|
|
34
|
+
*/
|
|
35
|
+
function alpha01(a) {
|
|
36
|
+
return num6(Math.max(0, Math.min(1, a)));
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* A 3x3 matrix times a vector.
|
|
40
|
+
* @param m - the matrix, row by row
|
|
41
|
+
* @param v - the vector
|
|
42
|
+
* @returns m * v
|
|
43
|
+
*/
|
|
44
|
+
function mul(m, v) {
|
|
45
|
+
return [
|
|
46
|
+
m[0][0] * v[0] + m[0][1] * v[1] + m[0][2] * v[2],
|
|
47
|
+
m[1][0] * v[0] + m[1][1] * v[1] + m[1][2] * v[2],
|
|
48
|
+
m[2][0] * v[0] + m[2][1] * v[1] + m[2][2] * v[2],
|
|
49
|
+
];
|
|
50
|
+
}
|
|
51
|
+
const LIN_TO_XYZ = [
|
|
52
|
+
[0.41239079926595934, 0.357584339383878, 0.1804807884018343],
|
|
53
|
+
[0.21263900587151027, 0.715168678767756, 0.07219231536073371],
|
|
54
|
+
[0.01933081871559182, 0.11919477979462598, 0.9505321522496607],
|
|
55
|
+
];
|
|
56
|
+
const XYZ_TO_LIN = [
|
|
57
|
+
[3.2409699419045226, -1.537383177570094, -0.4986107602930034],
|
|
58
|
+
[-0.9692436362808796, 1.8759675015077202, 0.04155505740717559],
|
|
59
|
+
[0.05563007969699366, -0.20397695888897652, 1.0569715142428786],
|
|
60
|
+
];
|
|
61
|
+
const XYZ_TO_LMS = [
|
|
62
|
+
[0.819022437996703, 0.3619062600528904, -0.1288737815209879],
|
|
63
|
+
[0.0329836539323885, 0.929286861586343, 0.0361446663506424],
|
|
64
|
+
[0.0481771893596242, 0.2642395317527308, 0.6335478284694309],
|
|
65
|
+
];
|
|
66
|
+
const LMS_TO_XYZ = [
|
|
67
|
+
[1.2268798758459243, -0.5578149944602171, 0.2813910456659647],
|
|
68
|
+
[-0.0405757452148008, 1.112286803280317, -0.0717110580655164],
|
|
69
|
+
[-0.0763729366746601, -0.4214933324022432, 1.5869240198367816],
|
|
70
|
+
];
|
|
71
|
+
const LMS_TO_LAB = [
|
|
72
|
+
[0.210454268309314, 0.7936177747023054, -0.0040720430116193],
|
|
73
|
+
[1.9779985324311684, -2.42859224204858, 0.450593709617411],
|
|
74
|
+
[0.0259040424655478, 0.7827717124575296, -0.8086757549230774],
|
|
75
|
+
];
|
|
76
|
+
const LAB_TO_LMS = [
|
|
77
|
+
[1, 0.3963377773761749, 0.2158037573099136],
|
|
78
|
+
[1, -0.1055613458156586, -0.0638541728258133],
|
|
79
|
+
[1, -0.0894841775298119, -1.2914855480194092],
|
|
80
|
+
];
|
|
81
|
+
/**
|
|
82
|
+
* sRGB (0..1, possibly out of range) to OKLab.
|
|
83
|
+
* @param rgb - the channels
|
|
84
|
+
* @returns L, a, b
|
|
85
|
+
*/
|
|
86
|
+
function srgbToOklab(rgb) {
|
|
87
|
+
const lin = rgb.map((c) => {
|
|
88
|
+
const a = Math.abs(c);
|
|
89
|
+
return Math.sign(c) * (a <= 0.04045 ? a / 12.92 : ((a + 0.055) / 1.055) ** 2.4);
|
|
90
|
+
});
|
|
91
|
+
const lms = mul(XYZ_TO_LMS, mul(LIN_TO_XYZ, lin));
|
|
92
|
+
return mul(LMS_TO_LAB, lms.map(Math.cbrt));
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* OKLab to sRGB (0..1, possibly out of range).
|
|
96
|
+
* @param lab - L, a, b
|
|
97
|
+
* @returns the channels
|
|
98
|
+
*/
|
|
99
|
+
function oklabToSrgb(lab) {
|
|
100
|
+
const lms = mul(LAB_TO_LMS, lab).map((c) => c ** 3);
|
|
101
|
+
return mul(XYZ_TO_LIN, mul(LMS_TO_XYZ, lms)).map((c) => {
|
|
102
|
+
const a = Math.abs(c);
|
|
103
|
+
return Math.sign(c) * (a > 0.0031308 ? 1.055 * a ** (1 / 2.4) - 0.055 : 12.92 * a);
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Whether sRGB channels are within 0..1.
|
|
108
|
+
* @param rgb - the channels
|
|
109
|
+
* @returns true when every channel is in range
|
|
110
|
+
*/
|
|
111
|
+
function inGamut(rgb) {
|
|
112
|
+
return rgb.every((c) => c >= 0 && c <= 1);
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Clamps sRGB channels to 0..1.
|
|
116
|
+
* @param rgb - the channels
|
|
117
|
+
* @returns the clamped channels
|
|
118
|
+
*/
|
|
119
|
+
function clip(rgb) {
|
|
120
|
+
return rgb.map((c) => Math.max(0, Math.min(1, c)));
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Distance in OKLab.
|
|
124
|
+
* @param p - one color
|
|
125
|
+
* @param q - the other
|
|
126
|
+
* @returns delta E OK
|
|
127
|
+
*/
|
|
128
|
+
function deltaEOK(p, q) {
|
|
129
|
+
return Math.hypot(p[0] - q[0], p[1] - q[1], p[2] - q[2]);
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* CSS Color 4's gamut mapping into sRGB: chroma is reduced in OKLCh until clipping changes the color by less than
|
|
133
|
+
* a just noticeable difference. It is what graphty-element's color parser does with an out-of-range `rgb()` or
|
|
134
|
+
* `hsl()`, so a canonical color equals the color graphty-element draws for the same text.
|
|
135
|
+
* @param rgb - sRGB channels 0..1, possibly out of range
|
|
136
|
+
* @returns channels within 0..1
|
|
137
|
+
*/
|
|
138
|
+
function toGamut(rgb) {
|
|
139
|
+
if (inGamut(rgb)) {
|
|
140
|
+
return rgb;
|
|
141
|
+
}
|
|
142
|
+
const JND = 0.02;
|
|
143
|
+
const [l, a, b] = srgbToOklab(rgb);
|
|
144
|
+
if (l >= 1) {
|
|
145
|
+
return [1, 1, 1];
|
|
146
|
+
}
|
|
147
|
+
if (l <= 0) {
|
|
148
|
+
return [0, 0, 0];
|
|
149
|
+
}
|
|
150
|
+
// The hue in degrees and back, as graphty-element's OKLCh does, so channels on a rounding edge round the same way.
|
|
151
|
+
const achromatic = Math.abs(a) < 0.0002 && Math.abs(b) < 0.0002;
|
|
152
|
+
const degrees = ((((Math.atan2(b, a) * 180) / Math.PI) % 360) + 360) % 360;
|
|
153
|
+
const at = (chroma) => achromatic
|
|
154
|
+
? [l, 0, 0]
|
|
155
|
+
: [l, chroma * Math.cos((degrees * Math.PI) / 180), chroma * Math.sin((degrees * Math.PI) / 180)];
|
|
156
|
+
const chroma0 = Math.sqrt(a ** 2 + b ** 2); // NOSONAR(S7769): colorjs.io's own formula, so chroma matches it bit for bit
|
|
157
|
+
const first = oklabToSrgb(at(chroma0));
|
|
158
|
+
if (inGamut(first)) {
|
|
159
|
+
return first;
|
|
160
|
+
}
|
|
161
|
+
const clipped = clip(first);
|
|
162
|
+
if (deltaEOK(srgbToOklab(clipped), at(chroma0)) < JND) {
|
|
163
|
+
// Clipping is close enough: clip the channels as given, without the round trip's rounding noise.
|
|
164
|
+
return clip(rgb);
|
|
165
|
+
}
|
|
166
|
+
return bisectChroma(at, chroma0, clipped);
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* CSS Color 4's chroma bisection: the largest chroma whose clipped color is within a just noticeable difference.
|
|
170
|
+
* A bisection: log2(chroma / EPSILON) rounds, about 30 for the most extreme finite input.
|
|
171
|
+
* @param at - the OKLab color of a chroma at the color's lightness and hue
|
|
172
|
+
* @param chroma0 - the color's own chroma
|
|
173
|
+
* @param first - the clipped color at that chroma
|
|
174
|
+
* @returns the clipped color found
|
|
175
|
+
*/
|
|
176
|
+
function bisectChroma(at, chroma0, first) {
|
|
177
|
+
const JND = 0.02;
|
|
178
|
+
const EPSILON = 0.0001;
|
|
179
|
+
let clipped = first;
|
|
180
|
+
let min = 0;
|
|
181
|
+
let max = chroma0;
|
|
182
|
+
let minInGamut = true;
|
|
183
|
+
while (max - min > EPSILON) {
|
|
184
|
+
const chroma = (min + max) / 2;
|
|
185
|
+
const current = at(chroma);
|
|
186
|
+
const rgbNow = oklabToSrgb(current);
|
|
187
|
+
if (minInGamut && inGamut(rgbNow)) {
|
|
188
|
+
min = chroma;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
clipped = clip(rgbNow);
|
|
192
|
+
const e = deltaEOK(srgbToOklab(clipped), current);
|
|
193
|
+
if (e >= JND) {
|
|
194
|
+
max = chroma;
|
|
195
|
+
}
|
|
196
|
+
else if (JND - e < EPSILON) {
|
|
197
|
+
break;
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
minInGamut = false;
|
|
201
|
+
min = chroma;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return clipped;
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
* sRGB channels 0..1 (after gamut mapping) as `#rrggbb`.
|
|
208
|
+
* @param rgb - the channels
|
|
209
|
+
* @returns the color
|
|
210
|
+
*/
|
|
211
|
+
function srgbHex(rgb) {
|
|
212
|
+
const [r, g, b] = toGamut(rgb);
|
|
213
|
+
return rgbHex(r * 255, g * 255, b * 255);
|
|
214
|
+
}
|
|
215
|
+
// ------------------------------------------------------------ CSS functional notation
|
|
216
|
+
/** One CSS number, without its unit. */
|
|
217
|
+
const CSS_NUMBER = /^[+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i;
|
|
218
|
+
/** A CSS number's unit: a percentage or an angle. */
|
|
219
|
+
const CSS_UNIT = /(%|deg|grad|rad|turn)$/i;
|
|
220
|
+
/**
|
|
221
|
+
* Splits a functional color's arguments: commas or blanks, with an optional `/` before the alpha.
|
|
222
|
+
* @param body - the text between the parentheses
|
|
223
|
+
* @returns the arguments and the alpha argument, or null when malformed
|
|
224
|
+
*/
|
|
225
|
+
function cssArgs(body) {
|
|
226
|
+
const slash = body.split("/");
|
|
227
|
+
if (slash.length > 2) {
|
|
228
|
+
return null;
|
|
229
|
+
}
|
|
230
|
+
const parts = slash[0].split(/[\s,]+/).filter((p) => p !== "");
|
|
231
|
+
let alpha = slash.length === 2 ? slash[1].trim() : undefined;
|
|
232
|
+
if (alpha === undefined && parts.length === 4) {
|
|
233
|
+
alpha = parts.pop();
|
|
234
|
+
}
|
|
235
|
+
return parts.length === 3 && alpha !== "" ? { parts, alpha } : null;
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Reads one CSS number.
|
|
239
|
+
* @param text - the argument
|
|
240
|
+
* @returns the value and its unit (lowercase, "" for none), or null
|
|
241
|
+
*/
|
|
242
|
+
function cssNumber(text) {
|
|
243
|
+
const unit = CSS_UNIT.exec(text)?.[1] ?? "";
|
|
244
|
+
const number = text.slice(0, text.length - unit.length);
|
|
245
|
+
if (!CSS_NUMBER.test(number)) {
|
|
246
|
+
return null;
|
|
247
|
+
}
|
|
248
|
+
const value = Number(number);
|
|
249
|
+
return Number.isFinite(value) ? { value, unit: unit.toLowerCase() } : null;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Reads a CSS alpha: a number 0..1 or a percentage, clamped.
|
|
253
|
+
* @param text - the argument, or undefined for none
|
|
254
|
+
* @returns the alpha, or null when malformed
|
|
255
|
+
*/
|
|
256
|
+
function cssAlpha(text) {
|
|
257
|
+
if (text === undefined) {
|
|
258
|
+
return 1;
|
|
259
|
+
}
|
|
260
|
+
const n = cssNumber(text);
|
|
261
|
+
if (n === null || (n.unit !== "" && n.unit !== "%")) {
|
|
262
|
+
return null;
|
|
263
|
+
}
|
|
264
|
+
return alpha01(n.unit === "%" ? n.value / 100 : n.value);
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* `rgb()`, `rgba()`, `hsl()` and `hsla()` as graphty-element reads them: channels and lightness out of range are
|
|
268
|
+
* gamut mapped, not refused.
|
|
269
|
+
* @param text - the value, trimmed
|
|
270
|
+
* @returns the color, or null when it is not one
|
|
271
|
+
*/
|
|
272
|
+
function cssFunction(text) {
|
|
273
|
+
const m = /^(rgba?|hsla?)\(([^()]*)\)$/i.exec(text);
|
|
274
|
+
if (m === null) {
|
|
275
|
+
return null;
|
|
276
|
+
}
|
|
277
|
+
const args = cssArgs(m[2]);
|
|
278
|
+
if (args === null) {
|
|
279
|
+
return null;
|
|
280
|
+
}
|
|
281
|
+
const nums = args.parts.map(cssNumber);
|
|
282
|
+
const alpha = cssAlpha(args.alpha);
|
|
283
|
+
if (nums.includes(null) || alpha === null) {
|
|
284
|
+
return null;
|
|
285
|
+
}
|
|
286
|
+
const [x, y, z] = nums;
|
|
287
|
+
if (m[1].toLowerCase().startsWith("rgb")) {
|
|
288
|
+
if ([x, y, z].some((n) => n.unit !== "" && n.unit !== "%")) {
|
|
289
|
+
return null;
|
|
290
|
+
}
|
|
291
|
+
const ch = [x, y, z].map((n) => (n.unit === "%" ? n.value / 100 : n.value / 255));
|
|
292
|
+
return { hex: srgbHex(ch), alpha };
|
|
293
|
+
}
|
|
294
|
+
const turns = { "": 360, deg: 360, grad: 400, rad: 2 * Math.PI, turn: 1 };
|
|
295
|
+
if (x.unit === "%" || !Object.hasOwn(turns, x.unit) || [y, z].some((n) => n.unit !== "" && n.unit !== "%")) {
|
|
296
|
+
return null;
|
|
297
|
+
}
|
|
298
|
+
const h = ((((x.value / turns[x.unit]) * 360) % 360) + 360) % 360;
|
|
299
|
+
const s = y.value / 100;
|
|
300
|
+
const l = z.value / 100;
|
|
301
|
+
const f = (n) => {
|
|
302
|
+
const k = (n + h / 30) % 12;
|
|
303
|
+
return l - s * Math.min(l, 1 - l) * Math.max(-1, Math.min(k - 3, 9 - k, 1));
|
|
304
|
+
};
|
|
305
|
+
return { hex: srgbHex([f(0), f(8), f(4)]), alpha };
|
|
306
|
+
}
|
|
307
|
+
// ------------------------------------------------------------ hex and names
|
|
308
|
+
/**
|
|
309
|
+
* A `#` hex color of 3, 4, 6 or 8 digits. Eight digits put the alpha last, except in yFiles 3, which puts it first.
|
|
310
|
+
* @param text - the value, trimmed
|
|
311
|
+
* @param alphaFirst - whether 8 digits are `#AARRGGBB`
|
|
312
|
+
* @returns the color, or null
|
|
313
|
+
*/
|
|
314
|
+
function hexColor(text, alphaFirst) {
|
|
315
|
+
const m = /^#([0-9a-f]+)$/i.exec(text);
|
|
316
|
+
if (m === null) {
|
|
317
|
+
return null;
|
|
318
|
+
}
|
|
319
|
+
const h = m[1];
|
|
320
|
+
const byte = (i) => Number.parseInt(h.slice(i, i + 2), 16);
|
|
321
|
+
switch (h.length) {
|
|
322
|
+
case 3:
|
|
323
|
+
case 4: {
|
|
324
|
+
const v = Array.from(h, (c) => Number.parseInt(c + c, 16));
|
|
325
|
+
return { hex: rgbHex(v[0], v[1], v[2]), alpha: h.length === 4 ? alpha01(v[3] / 255) : 1 };
|
|
326
|
+
}
|
|
327
|
+
case 6:
|
|
328
|
+
return { hex: `#${h.toLowerCase()}`, alpha: 1 };
|
|
329
|
+
case 8:
|
|
330
|
+
return alphaFirst
|
|
331
|
+
? { hex: rgbHex(byte(2), byte(4), byte(6)), alpha: alpha01(byte(0) / 255) }
|
|
332
|
+
: { hex: rgbHex(byte(0), byte(2), byte(4)), alpha: alpha01(byte(6) / 255) };
|
|
333
|
+
default:
|
|
334
|
+
return null;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* A CSS color as graphty-element reads it: hex, `rgb()`/`hsl()` and their alpha forms, a CSS name or
|
|
339
|
+
* `transparent`.
|
|
340
|
+
* @param text - the value, trimmed
|
|
341
|
+
* @returns the color, or null
|
|
342
|
+
*/
|
|
343
|
+
function cssColor(text) {
|
|
344
|
+
const lower = text.toLowerCase();
|
|
345
|
+
if (lower === "transparent") {
|
|
346
|
+
return { hex: "#000000", alpha: 0 };
|
|
347
|
+
}
|
|
348
|
+
const named = CSS_COLORS.get(lower);
|
|
349
|
+
if (named !== undefined) {
|
|
350
|
+
return { hex: named, alpha: 1 };
|
|
351
|
+
}
|
|
352
|
+
return hexColor(text, false) ?? cssFunction(text);
|
|
353
|
+
}
|
|
354
|
+
/** One of Pajek's decimal color channels in `RGB(1,0.8,0)`: 0..1, no spaces (Pajek 6.02 manual p. 76). */
|
|
355
|
+
const PAJEK_CHANNEL = /^(?:\d+(?:\.\d*)?|\.\d+)$/;
|
|
356
|
+
/**
|
|
357
|
+
* Pajek's color names: the dvips names as written, `GrayNN` (NN percent black), `RGBrrggbb`, `RGB(r,g,b)` with
|
|
358
|
+
* channels 0..1, `CMYKccmmyykk` and `CMYK(c,m,y,k)` (CMYK converted as dvips converts its names: each channel is
|
|
359
|
+
* 1 - min(1, c + k)).
|
|
360
|
+
* @param text - the value, trimmed
|
|
361
|
+
* @returns the color, or null
|
|
362
|
+
*/
|
|
363
|
+
function pajekColor(text) {
|
|
364
|
+
const named = DVIPS_COLORS.get(text);
|
|
365
|
+
if (named !== undefined) {
|
|
366
|
+
return { hex: named, alpha: 1 };
|
|
367
|
+
}
|
|
368
|
+
const gray = /^Gray(\d\d)$/.exec(text);
|
|
369
|
+
if (gray !== null) {
|
|
370
|
+
const v = 255 * (1 - Number(gray[1]) / 100);
|
|
371
|
+
return { hex: rgbHex(v, v, v), alpha: 1 };
|
|
372
|
+
}
|
|
373
|
+
const rgb = /^RGB([0-9A-Fa-f]{6})$/.exec(text);
|
|
374
|
+
if (rgb !== null) {
|
|
375
|
+
return { hex: `#${rgb[1].toLowerCase()}`, alpha: 1 };
|
|
376
|
+
}
|
|
377
|
+
const cmyk = /^CMYK([0-9A-Fa-f]{8})$/.exec(text);
|
|
378
|
+
let parts = null;
|
|
379
|
+
let model = "";
|
|
380
|
+
if (cmyk === null) {
|
|
381
|
+
const fn = /^(RGB|CMYK)\(([^()]*)\)$/.exec(text);
|
|
382
|
+
const channels = fn === null ? [] : fn[2].split(",");
|
|
383
|
+
if (fn !== null && channels.every((c) => PAJEK_CHANNEL.test(c))) {
|
|
384
|
+
model = fn[1];
|
|
385
|
+
parts = channels.map(Number);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
model = "CMYK";
|
|
390
|
+
parts = [0, 2, 4, 6].map((i) => Number.parseInt(cmyk[1].slice(i, i + 2), 16) / 255);
|
|
391
|
+
}
|
|
392
|
+
if (parts === null || parts.some((p) => p > 1) || parts.length !== (model === "RGB" ? 3 : 4)) {
|
|
393
|
+
return hexColor(text, false);
|
|
394
|
+
}
|
|
395
|
+
if (model === "RGB") {
|
|
396
|
+
return { hex: rgbHex(parts[0] * 255, parts[1] * 255, parts[2] * 255), alpha: 1 };
|
|
397
|
+
}
|
|
398
|
+
const [c, m, y, k] = parts;
|
|
399
|
+
const ch = (v) => 255 * (1 - Math.min(1, v + k));
|
|
400
|
+
return { hex: rgbHex(ch(c), ch(m), ch(y)), alpha: 1 };
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* A color given as separate channels (`{ r, g, b, a? }`, GEXF's `viz:color` and Gephi's keys): r, g and b 0..255,
|
|
404
|
+
* a 0..1.
|
|
405
|
+
* @param raw - the object
|
|
406
|
+
* @returns the color, or null when a channel is missing or out of range
|
|
407
|
+
*/
|
|
408
|
+
function channels(raw) {
|
|
409
|
+
if (!Object.hasOwn(raw, "r") || !Object.hasOwn(raw, "g") || !Object.hasOwn(raw, "b")) {
|
|
410
|
+
return null;
|
|
411
|
+
}
|
|
412
|
+
const o = raw;
|
|
413
|
+
const [r, g, b] = [o.r, o.g, o.b].map((v) => typeof v === "number" || typeof v === "string" ? Number(v) : Number.NaN);
|
|
414
|
+
if (![r, g, b].every((v) => Number.isFinite(v) && v >= 0 && v <= 255)) {
|
|
415
|
+
return null;
|
|
416
|
+
}
|
|
417
|
+
const a = Object.hasOwn(raw, "a") && o.a !== undefined && o.a !== null ? Number(o.a) : 1;
|
|
418
|
+
return Number.isFinite(a) ? { hex: rgbHex(r, g, b), alpha: alpha01(a) } : null;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* A canonical color in the file's dialect, or null with a note.
|
|
422
|
+
*
|
|
423
|
+
* - CSS (`css`, `vis`, `graphology`, `cytoscape-js`, `graphty` and any dialect not listed): `#rgb`, `#rgba`,
|
|
424
|
+
* `#rrggbb`, `#rrggbbaa`, `rgb()`, `rgba()`, `hsl()`, `hsla()`, CSS names and `transparent`, resolved as
|
|
425
|
+
* graphty-element resolves them (out-of-range channels are gamut mapped).
|
|
426
|
+
* - `graphviz`: Graphviz's own rules (see `graphvizColor`); an unknown color is BLACK, with a note, because that is
|
|
427
|
+
* what Graphviz draws. `x11`: the same names, and an unknown one is null.
|
|
428
|
+
* - `java`, `gephi`, `cytoscape`: the `java.awt.Color` names first, then CSS; a `java` integer is an RGB value.
|
|
429
|
+
* - `dvips`: Pajek's names.
|
|
430
|
+
* - `yed`: `#RRGGBBAA` with the alpha last; `yfiles3`: `#AARRGGBB` with the alpha first and constants such as
|
|
431
|
+
* `DARK_ORANGE`.
|
|
432
|
+
* - `gexf` and `gephi` also take `{ r, g, b, a }` objects.
|
|
433
|
+
*
|
|
434
|
+
* A Graphviz color list is read as `options.use` says and noted (`W_STYLE_GRADIENT`, `W_STYLE_COLOR_LIST`).
|
|
435
|
+
* @param raw - the file's value
|
|
436
|
+
* @param dialect - the file's dialect
|
|
437
|
+
* @param site - where it was read
|
|
438
|
+
* @param options - Graphviz's scheme and use
|
|
439
|
+
* @returns the color and its alpha, or null
|
|
440
|
+
* @category Styles
|
|
441
|
+
*/
|
|
442
|
+
export function canonColor(raw, dialect, site, options = {}) {
|
|
443
|
+
if (raw !== null && typeof raw === "object") {
|
|
444
|
+
return objectColor(raw, dialect, site);
|
|
445
|
+
}
|
|
446
|
+
if (typeof raw === "number" && dialect === "java" && Number.isInteger(raw) && Math.abs(raw) <= 0xffffffff) {
|
|
447
|
+
spendAt(site, 1);
|
|
448
|
+
const v = raw >>> 0;
|
|
449
|
+
return { color: rgbHex((v >>> 16) & 255, (v >>> 8) & 255, v & 255), alpha: 1 };
|
|
450
|
+
}
|
|
451
|
+
const text = scalarText(raw, site);
|
|
452
|
+
if (text === null) {
|
|
453
|
+
return null;
|
|
454
|
+
}
|
|
455
|
+
if (dialect === "graphviz" || dialect === "x11") {
|
|
456
|
+
return graphvizCanon(text, dialect === "x11" ? "x11" : "graphviz", site, options);
|
|
457
|
+
}
|
|
458
|
+
const c = textColor(text.trim(), dialect);
|
|
459
|
+
if (c === null) {
|
|
460
|
+
noteAt(site, STYLE_ISSUE.BAD_VALUE, text);
|
|
461
|
+
return null;
|
|
462
|
+
}
|
|
463
|
+
return { color: c.hex, alpha: c.alpha };
|
|
464
|
+
}
|
|
465
|
+
/**
|
|
466
|
+
* A color given as an object: only GEXF and Gephi write one, as channels.
|
|
467
|
+
* @param raw - the object
|
|
468
|
+
* @param dialect - the file's dialect
|
|
469
|
+
* @param site - where it was read
|
|
470
|
+
* @returns the color and its alpha, or null with a note
|
|
471
|
+
*/
|
|
472
|
+
function objectColor(raw, dialect, site) {
|
|
473
|
+
spendAt(site, 1);
|
|
474
|
+
const c = dialect === "gexf" || dialect === "gephi" ? channels(raw) : null;
|
|
475
|
+
if (c === null) {
|
|
476
|
+
noteAt(site, STYLE_ISSUE.BAD_VALUE, raw);
|
|
477
|
+
return null;
|
|
478
|
+
}
|
|
479
|
+
return { color: c.hex, alpha: c.alpha };
|
|
480
|
+
}
|
|
481
|
+
/**
|
|
482
|
+
* A Graphviz or X11 color: Graphviz draws an unknown color black; a plain X11 name that is unknown is no color at all.
|
|
483
|
+
* @param text - the value
|
|
484
|
+
* @param dialect - `graphviz` or `x11`
|
|
485
|
+
* @param site - where it was read
|
|
486
|
+
* @param options - Graphviz's scheme and use
|
|
487
|
+
* @returns the color and its alpha, or null
|
|
488
|
+
*/
|
|
489
|
+
function graphvizCanon(text, dialect, site, options) {
|
|
490
|
+
const g = graphvizColor(text, dialect === "x11" ? null : (options.scheme ?? null), options.use ?? "line");
|
|
491
|
+
if (g.unknown) {
|
|
492
|
+
noteAt(site, STYLE_ISSUE.BAD_VALUE, text);
|
|
493
|
+
if (dialect === "x11") {
|
|
494
|
+
return null;
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
if (g.list !== null) {
|
|
498
|
+
noteAt(site, g.list === "gradient" ? STYLE_ISSUE.GRADIENT : STYLE_ISSUE.COLOR_LIST, text);
|
|
499
|
+
}
|
|
500
|
+
return { color: g.hex, alpha: alpha01(g.alpha) };
|
|
501
|
+
}
|
|
502
|
+
/**
|
|
503
|
+
* A color written as text in a dialect other than Graphviz's.
|
|
504
|
+
* @param trimmed - the value, trimmed
|
|
505
|
+
* @param dialect - the file's dialect
|
|
506
|
+
* @returns the color and its alpha, or null
|
|
507
|
+
*/
|
|
508
|
+
function textColor(trimmed, dialect) {
|
|
509
|
+
const lower = trimmed.toLowerCase();
|
|
510
|
+
switch (dialect) {
|
|
511
|
+
case "dvips":
|
|
512
|
+
return pajekColor(trimmed);
|
|
513
|
+
case "yfiles3":
|
|
514
|
+
return hexColor(trimmed, true) ?? cssColor(lower.replaceAll("_", ""));
|
|
515
|
+
case "java":
|
|
516
|
+
case "gephi":
|
|
517
|
+
case "cytoscape": {
|
|
518
|
+
const java = JAVA_COLORS.get(lower);
|
|
519
|
+
return java === undefined ? cssColor(trimmed) : { hex: java, alpha: 1 };
|
|
520
|
+
}
|
|
521
|
+
default:
|
|
522
|
+
return cssColor(trimmed);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Moves a color's alpha into the property's opacity. When the property has an opacity (`fill` has `fillOpacity`,
|
|
527
|
+
* an edge's `color` has `opacity`) the alpha is multiplied with any opacity the file also states; when it has none
|
|
528
|
+
* (an outline, a label color) an alpha below 1 is dropped and noted as `W_STYLE_ALPHA_DROPPED`.
|
|
529
|
+
* @param color - the canonical color
|
|
530
|
+
* @param stated - the opacity the file states for the same element, or null
|
|
531
|
+
* @param site - where the color was read
|
|
532
|
+
* @param carried - whether the property has an opacity to carry the alpha
|
|
533
|
+
* @returns the opacity to write, or null when there is none to write
|
|
534
|
+
* @category Styles
|
|
535
|
+
*/
|
|
536
|
+
export function colorOpacity(color, stated, site, carried) {
|
|
537
|
+
if (!carried) {
|
|
538
|
+
if (color.alpha < 1) {
|
|
539
|
+
noteAt(site, STYLE_ISSUE.ALPHA_DROPPED, color.color);
|
|
540
|
+
}
|
|
541
|
+
return stated;
|
|
542
|
+
}
|
|
543
|
+
if (color.alpha === 1) {
|
|
544
|
+
return stated;
|
|
545
|
+
}
|
|
546
|
+
return num6((stated ?? 1) * color.alpha);
|
|
547
|
+
}
|
|
548
|
+
//# sourceMappingURL=color.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.js","sourceRoot":"","sources":["../../../../src/styles/canon/color.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAE1C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAC1E,OAAO,EAAE,aAAa,EAAyB,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAkB,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AA2BxE;;;;GAIG;AACH,SAAS,IAAI,CAAC,CAAS;IACnB,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;SAC3C,QAAQ,CAAC,EAAE,CAAC;SACZ,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED;;;;;;GAMG;AACH,SAAS,MAAM,CAAC,CAAS,EAAE,CAAS,EAAE,CAAS;IAC3C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B,KAAiB,EACjB,MAAqB,EACrB,IAAe,EACf,OAAgB;IAEhB,IAAI,CAAC,OAAO,EAAE,CAAC;QACX,IAAI,KAAK,CAAC,KAAK,GAAG,CAAC,EAAE,CAAC;YAClB,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,aAAa,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;QACzD,CAAC;QACD,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,IAAI,KAAK,CAAC,KAAK,KAAK,CAAC,EAAE,CAAC;QACpB,OAAO,MAAM,CAAC;IAClB,CAAC;IACD,OAAO,IAAI,CAAC,CAAC,MAAM,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;AAC7C,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Canonical enumeration values: each dialect's spellings matched against an alias table without regard to case,
|
|
3
|
+
* spaces or underscores. An unknown value of an open enumeration (shapes, border and line styles, arrows) is kept as
|
|
4
|
+
* `other:<raw>` and noted; an unknown value of a closed one (weights, positions) gives no value and is noted.
|
|
5
|
+
*/
|
|
6
|
+
import type { StyleDialect } from "../types.js";
|
|
7
|
+
import { type CanonSite } from "./site.js";
|
|
8
|
+
/**
|
|
9
|
+
* The enumerations a style value can belong to.
|
|
10
|
+
* @category Styles
|
|
11
|
+
*/
|
|
12
|
+
export type StyleEnumKind = "shape" | "borderStyle" | "lineStyle" | "arrow" | "weight" | "position";
|
|
13
|
+
/**
|
|
14
|
+
* A canonical enumeration value: the dialect's spelling matched without regard to case, with spaces and underscores
|
|
15
|
+
* read as hyphens (Cytoscape's `ROUND_RECTANGLE` is `round-rectangle`). An unknown value is `other:<raw>` for an
|
|
16
|
+
* open enumeration and null for a closed one, noted as `W_STYLE_UNKNOWN_VALUE` either way.
|
|
17
|
+
* @param kind - the enumeration
|
|
18
|
+
* @param raw - the file's value
|
|
19
|
+
* @param dialect - the file's dialect
|
|
20
|
+
* @param site - where it was read
|
|
21
|
+
* @returns the canonical value, or null
|
|
22
|
+
* @category Styles
|
|
23
|
+
*/
|
|
24
|
+
export declare function canonEnum(kind: StyleEnumKind, raw: unknown, dialect: StyleDialect, site: CanonSite): string | null;
|
|
25
|
+
//# sourceMappingURL=enums.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../../../src/styles/canon/enums.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,KAAK,SAAS,EAAsB,MAAM,WAAW,CAAC;AAE/D;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,aAAa,GAAG,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,UAAU,CAAC;AA4KpG;;;;;;;;;;GAUG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,aAAa,EAAE,GAAG,EAAE,OAAO,EAAE,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,CAalH"}
|