@graphty/graph-io 0.3.48 → 0.3.50

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.
Files changed (600) hide show
  1. package/dist/chunks/{approximations-C2riR4NT.js → approximations-BRXsll0T.js} +2 -2
  2. package/dist/chunks/{approximations-C2riR4NT.js.map → approximations-BRXsll0T.js.map} +1 -1
  3. package/dist/chunks/bends-BGXjv_U4.js +129 -0
  4. package/dist/chunks/bends-BGXjv_U4.js.map +1 -0
  5. package/dist/chunks/{block-Cu22ewuS.js → block-yl0f_qLO.js} +931 -164
  6. package/dist/chunks/block-yl0f_qLO.js.map +1 -0
  7. package/dist/chunks/choose-CczZJaX_.js +717 -0
  8. package/dist/chunks/choose-CczZJaX_.js.map +1 -0
  9. package/dist/chunks/{codes-CV_Bhcyi.js → codes-BE2xir2k.js} +6 -2
  10. package/dist/chunks/codes-BE2xir2k.js.map +1 -0
  11. package/dist/chunks/{constants-D0LqcsLJ.js → constants-CKkYLPtt.js} +2 -2
  12. package/dist/chunks/{constants-D0LqcsLJ.js.map → constants-CKkYLPtt.js.map} +1 -1
  13. package/dist/chunks/{context-cgmmOxZ2.js → context-DizmppHy.js} +5 -4
  14. package/dist/chunks/{context-cgmmOxZ2.js.map → context-DizmppHy.js.map} +1 -1
  15. package/dist/chunks/{convert-BcQ8_jMo.js → convert-Ct2zelbQ.js} +7 -2
  16. package/dist/chunks/convert-Ct2zelbQ.js.map +1 -0
  17. package/dist/chunks/{credentials-BiQsnMTb.js → credentials-CmvJXYeH.js} +67 -16
  18. package/dist/chunks/credentials-CmvJXYeH.js.map +1 -0
  19. package/dist/chunks/{cx-export-BEeF6ymo.js → cx-export-Bt6NoqTQ.js} +3 -3
  20. package/dist/chunks/{cx-export-BEeF6ymo.js.map → cx-export-Bt6NoqTQ.js.map} +1 -1
  21. package/dist/chunks/descriptor-B28U25x4.js +60 -0
  22. package/dist/chunks/descriptor-B28U25x4.js.map +1 -0
  23. package/dist/chunks/{descriptor-BJ-W0Jd-.js → descriptor-Dhez_Cew.js} +11 -2
  24. package/dist/chunks/descriptor-Dhez_Cew.js.map +1 -0
  25. package/dist/chunks/{emit-CD8xnY8s.js → emit-7Jkpg0yd.js} +1788 -133
  26. package/dist/chunks/emit-7Jkpg0yd.js.map +1 -0
  27. package/dist/chunks/{escape-DH2Egt-l.js → escape-CuCIzNMB.js} +8 -8
  28. package/dist/chunks/{escape-DH2Egt-l.js.map → escape-CuCIzNMB.js.map} +1 -1
  29. package/dist/chunks/{export-CZ7VRm4I.js → export-Cha4dRFz.js} +45 -387
  30. package/dist/chunks/export-Cha4dRFz.js.map +1 -0
  31. package/dist/chunks/{exporter-ChjL5fmP.js → exporter-1Ajud15J.js} +9 -8
  32. package/dist/chunks/{exporter-ChjL5fmP.js.map → exporter-1Ajud15J.js.map} +1 -1
  33. package/dist/chunks/{exporter-BIdaoIgh.js → exporter-B6yvL3wy.js} +7 -7
  34. package/dist/chunks/{exporter-BIdaoIgh.js.map → exporter-B6yvL3wy.js.map} +1 -1
  35. package/dist/chunks/{exporter-Dcw7Ldtq.js → exporter-BP6otMO6.js} +6 -6
  36. package/dist/chunks/{exporter-Dcw7Ldtq.js.map → exporter-BP6otMO6.js.map} +1 -1
  37. package/dist/chunks/{exporter-DtVU80Fa.js → exporter-CA5q8ROP.js} +9 -8
  38. package/dist/chunks/{exporter-DtVU80Fa.js.map → exporter-CA5q8ROP.js.map} +1 -1
  39. package/dist/chunks/{exporter-bxxjOrDZ.js → exporter-CQQZFJ2v.js} +1284 -156
  40. package/dist/chunks/exporter-CQQZFJ2v.js.map +1 -0
  41. package/dist/chunks/format-BXiAb-1h.js +408 -0
  42. package/dist/chunks/format-BXiAb-1h.js.map +1 -0
  43. package/dist/chunks/{generic-CP6YD34u.js → generic-Dc21MAdg.js} +387 -31
  44. package/dist/chunks/generic-Dc21MAdg.js.map +1 -0
  45. package/dist/chunks/{importer-B87_fmVx.js → importer-C6NVpCXp.js} +327 -84
  46. package/dist/chunks/importer-C6NVpCXp.js.map +1 -0
  47. package/dist/chunks/{importer-DPZDN40-.js → importer-CKFe4q54.js} +25 -17
  48. package/dist/chunks/importer-CKFe4q54.js.map +1 -0
  49. package/dist/chunks/{importer-Bji2MeWr.js → importer-CKbUbsJA.js} +13 -10
  50. package/dist/chunks/{importer-Bji2MeWr.js.map → importer-CKbUbsJA.js.map} +1 -1
  51. package/dist/chunks/{importer-CB_zV5_L.js → importer-ClCsdgTJ.js} +208 -1104
  52. package/dist/chunks/importer-ClCsdgTJ.js.map +1 -0
  53. package/dist/chunks/{importer-e3huMZbm.js → importer-CyVZTrf0.js} +14 -10
  54. package/dist/chunks/importer-CyVZTrf0.js.map +1 -0
  55. package/dist/chunks/{importer-CVT-JyDE.js → importer-DgG4v1Ms.js} +1537 -355
  56. package/dist/chunks/importer-DgG4v1Ms.js.map +1 -0
  57. package/dist/chunks/{importer-Cyy6UseH.js → importer-asFUrIsj.js} +66 -13
  58. package/dist/chunks/importer-asFUrIsj.js.map +1 -0
  59. package/dist/chunks/{input-Ccg9I22A.js → input-CAxt_aV-.js} +4 -4
  60. package/dist/chunks/{input-Ccg9I22A.js.map → input-CAxt_aV-.js.map} +1 -1
  61. package/dist/chunks/{json-elements-By172SVq.js → json-elements-Cq76WjnZ.js} +4 -4
  62. package/dist/chunks/{json-elements-By172SVq.js.map → json-elements-Cq76WjnZ.js.map} +1 -1
  63. package/dist/chunks/{lexicon-u2SI5xcx.js → lexicon-IVRq2Uoo.js} +282 -74
  64. package/dist/chunks/lexicon-IVRq2Uoo.js.map +1 -0
  65. package/dist/chunks/{ontology-export-BwgMyuF0.js → ontology-export-OMo91mb0.js} +4 -4
  66. package/dist/chunks/{ontology-export-BwgMyuF0.js.map → ontology-export-OMo91mb0.js.map} +1 -1
  67. package/dist/chunks/{records-Cgvxz-Vx.js → records-NJiYvekn.js} +2 -2
  68. package/dist/chunks/{records-Cgvxz-Vx.js.map → records-NJiYvekn.js.map} +1 -1
  69. package/dist/chunks/{report-CgdsL9Hb.js → report-CwMfYa9J.js} +23 -23
  70. package/dist/chunks/{report-CgdsL9Hb.js.map → report-CwMfYa9J.js.map} +1 -1
  71. package/dist/chunks/round-trip-Cy3_SHRZ.js +79 -0
  72. package/dist/chunks/round-trip-Cy3_SHRZ.js.map +1 -0
  73. package/dist/chunks/{sigv4-LkAzsLAu.js → sigv4-BXwVbza3.js} +5 -5
  74. package/dist/chunks/sigv4-BXwVbza3.js.map +1 -0
  75. package/dist/chunks/{styles-CaABMoO1.js → styles-CAVmBLgp.js} +1237 -138
  76. package/dist/chunks/styles-CAVmBLgp.js.map +1 -0
  77. package/dist/chunks/styles-CPczw1Jz.js +1928 -0
  78. package/dist/chunks/styles-CPczw1Jz.js.map +1 -0
  79. package/dist/chunks/styles-boK6Ln54.js +2847 -0
  80. package/dist/chunks/styles-boK6Ln54.js.map +1 -0
  81. package/dist/chunks/{styles-yed-Cs1nmrjn.js → styles-yed-XeFBQ6VS.js} +506 -175
  82. package/dist/chunks/styles-yed-XeFBQ6VS.js.map +1 -0
  83. package/dist/chunks/{text-BuKQVMz2.js → text-ystE2bYi.js} +2 -2
  84. package/dist/chunks/{text-BuKQVMz2.js.map → text-ystE2bYi.js.map} +1 -1
  85. package/dist/csv.js +7 -7
  86. package/dist/cx.js +2 -2
  87. package/dist/cx2.js +2 -2
  88. package/dist/cys.js +1 -1
  89. package/dist/dot.js +8 -4
  90. package/dist/dot.js.map +1 -1
  91. package/dist/gexf.js +42 -12
  92. package/dist/gexf.js.map +1 -1
  93. package/dist/gml.js +848 -194
  94. package/dist/gml.js.map +1 -1
  95. package/dist/graph-io.js +230 -193
  96. package/dist/graph-io.js.map +1 -1
  97. package/dist/graphml.js +3 -3
  98. package/dist/json.js +3 -2
  99. package/dist/neo4j.js +6 -6
  100. package/dist/obo.js +1 -1
  101. package/dist/pajek.js +1 -1
  102. package/dist/positions.js +45 -3
  103. package/dist/positions.js.map +1 -1
  104. package/dist/sources-cypher.js +141 -23
  105. package/dist/sources-cypher.js.map +1 -1
  106. package/dist/sources-ndex.js +2 -2
  107. package/dist/sources-rest.js +32 -6
  108. package/dist/sources-rest.js.map +1 -1
  109. package/dist/sources-sparql.d.ts +1 -0
  110. package/dist/sources-sparql.js +439 -0
  111. package/dist/sources-sparql.js.map +1 -0
  112. package/dist/src/formats/cx/importer.d.ts.map +1 -1
  113. package/dist/src/formats/cx/importer.js +5 -1
  114. package/dist/src/formats/cx/importer.js.map +1 -1
  115. package/dist/src/formats/cx/styles.d.ts +24 -1
  116. package/dist/src/formats/cx/styles.d.ts.map +1 -1
  117. package/dist/src/formats/cx/styles.js +117 -11
  118. package/dist/src/formats/cx/styles.js.map +1 -1
  119. package/dist/src/formats/cx2/importer.d.ts.map +1 -1
  120. package/dist/src/formats/cx2/importer.js +1 -0
  121. package/dist/src/formats/cx2/importer.js.map +1 -1
  122. package/dist/src/formats/cx2/styles.d.ts.map +1 -1
  123. package/dist/src/formats/cx2/styles.js +3 -1
  124. package/dist/src/formats/cx2/styles.js.map +1 -1
  125. package/dist/src/formats/cys/importer.d.ts.map +1 -1
  126. package/dist/src/formats/cys/importer.js +1 -0
  127. package/dist/src/formats/cys/importer.js.map +1 -1
  128. package/dist/src/formats/cys/styles.d.ts +2 -0
  129. package/dist/src/formats/cys/styles.d.ts.map +1 -1
  130. package/dist/src/formats/cys/styles.js +15 -7
  131. package/dist/src/formats/cys/styles.js.map +1 -1
  132. package/dist/src/formats/dot/drawing.d.ts +98 -0
  133. package/dist/src/formats/dot/drawing.d.ts.map +1 -0
  134. package/dist/src/formats/dot/drawing.js +734 -0
  135. package/dist/src/formats/dot/drawing.js.map +1 -0
  136. package/dist/src/formats/dot/exporter.d.ts.map +1 -1
  137. package/dist/src/formats/dot/exporter.js +34 -2
  138. package/dist/src/formats/dot/exporter.js.map +1 -1
  139. package/dist/src/formats/dot/importer.d.ts +6 -1
  140. package/dist/src/formats/dot/importer.d.ts.map +1 -1
  141. package/dist/src/formats/dot/importer.js +170 -33
  142. package/dist/src/formats/dot/importer.js.map +1 -1
  143. package/dist/src/formats/dot/index.d.ts +3 -1
  144. package/dist/src/formats/dot/index.d.ts.map +1 -1
  145. package/dist/src/formats/dot/index.js +2 -1
  146. package/dist/src/formats/dot/index.js.map +1 -1
  147. package/dist/src/formats/dot/label-places.d.ts +41 -0
  148. package/dist/src/formats/dot/label-places.d.ts.map +1 -0
  149. package/dist/src/formats/dot/label-places.js +185 -0
  150. package/dist/src/formats/dot/label-places.js.map +1 -0
  151. package/dist/src/formats/dot/names.d.ts +13 -0
  152. package/dist/src/formats/dot/names.d.ts.map +1 -1
  153. package/dist/src/formats/dot/names.js +13 -0
  154. package/dist/src/formats/dot/names.js.map +1 -1
  155. package/dist/src/formats/dot/record.d.ts +50 -0
  156. package/dist/src/formats/dot/record.d.ts.map +1 -0
  157. package/dist/src/formats/dot/record.js +275 -0
  158. package/dist/src/formats/dot/record.js.map +1 -0
  159. package/dist/src/formats/dot/styles.d.ts +72 -2
  160. package/dist/src/formats/dot/styles.d.ts.map +1 -1
  161. package/dist/src/formats/dot/styles.js +1500 -119
  162. package/dist/src/formats/dot/styles.js.map +1 -1
  163. package/dist/src/formats/gexf/dialog-metrics.d.ts +15 -0
  164. package/dist/src/formats/gexf/dialog-metrics.d.ts.map +1 -0
  165. package/dist/src/formats/gexf/dialog-metrics.js +59 -0
  166. package/dist/src/formats/gexf/dialog-metrics.js.map +1 -0
  167. package/dist/src/formats/gexf/importer.d.ts +7 -0
  168. package/dist/src/formats/gexf/importer.d.ts.map +1 -1
  169. package/dist/src/formats/gexf/importer.js +41 -5
  170. package/dist/src/formats/gexf/importer.js.map +1 -1
  171. package/dist/src/formats/gexf/preview.d.ts +77 -0
  172. package/dist/src/formats/gexf/preview.d.ts.map +1 -0
  173. package/dist/src/formats/gexf/preview.js +191 -0
  174. package/dist/src/formats/gexf/preview.js.map +1 -0
  175. package/dist/src/formats/gexf/schema.d.ts.map +1 -1
  176. package/dist/src/formats/gexf/schema.js +2 -1
  177. package/dist/src/formats/gexf/schema.js.map +1 -1
  178. package/dist/src/formats/gexf/styles.d.ts +58 -31
  179. package/dist/src/formats/gexf/styles.d.ts.map +1 -1
  180. package/dist/src/formats/gexf/styles.js +848 -225
  181. package/dist/src/formats/gexf/styles.js.map +1 -1
  182. package/dist/src/formats/gml/importer.d.ts +5 -2
  183. package/dist/src/formats/gml/importer.d.ts.map +1 -1
  184. package/dist/src/formats/gml/importer.js +258 -71
  185. package/dist/src/formats/gml/importer.js.map +1 -1
  186. package/dist/src/formats/gml/index.d.ts +1 -1
  187. package/dist/src/formats/gml/index.d.ts.map +1 -1
  188. package/dist/src/formats/gml/index.js +1 -1
  189. package/dist/src/formats/gml/index.js.map +1 -1
  190. package/dist/src/formats/gml/positions.d.ts +7 -0
  191. package/dist/src/formats/gml/positions.d.ts.map +1 -1
  192. package/dist/src/formats/gml/positions.js +29 -7
  193. package/dist/src/formats/gml/positions.js.map +1 -1
  194. package/dist/src/formats/gml/styles.d.ts.map +1 -1
  195. package/dist/src/formats/gml/styles.js +754 -102
  196. package/dist/src/formats/gml/styles.js.map +1 -1
  197. package/dist/src/formats/graphml/styles-plain.d.ts.map +1 -1
  198. package/dist/src/formats/graphml/styles-plain.js +6 -10
  199. package/dist/src/formats/graphml/styles-plain.js.map +1 -1
  200. package/dist/src/formats/graphml/styles-yed.d.ts +21 -15
  201. package/dist/src/formats/graphml/styles-yed.d.ts.map +1 -1
  202. package/dist/src/formats/graphml/styles-yed.js +695 -164
  203. package/dist/src/formats/graphml/styles-yed.js.map +1 -1
  204. package/dist/src/formats/graphml/styles-yfiles3.d.ts +1 -1
  205. package/dist/src/formats/graphml/styles-yfiles3.d.ts.map +1 -1
  206. package/dist/src/formats/graphml/styles-yfiles3.js +431 -64
  207. package/dist/src/formats/graphml/styles-yfiles3.js.map +1 -1
  208. package/dist/src/formats/graphml/yfiles.d.ts +3 -3
  209. package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
  210. package/dist/src/formats/graphml/yfiles.js +16 -6
  211. package/dist/src/formats/graphml/yfiles.js.map +1 -1
  212. package/dist/src/formats/json/dialect.d.ts +3 -2
  213. package/dist/src/formats/json/dialect.d.ts.map +1 -1
  214. package/dist/src/formats/json/dialect.js +39 -5
  215. package/dist/src/formats/json/dialect.js.map +1 -1
  216. package/dist/src/formats/json/importer.d.ts +13 -2
  217. package/dist/src/formats/json/importer.d.ts.map +1 -1
  218. package/dist/src/formats/json/importer.js +42 -6
  219. package/dist/src/formats/json/importer.js.map +1 -1
  220. package/dist/src/formats/json/index.d.ts +1 -1
  221. package/dist/src/formats/json/index.d.ts.map +1 -1
  222. package/dist/src/formats/json/index.js +1 -1
  223. package/dist/src/formats/json/index.js.map +1 -1
  224. package/dist/src/formats/json/positions.d.ts +5 -2
  225. package/dist/src/formats/json/positions.d.ts.map +1 -1
  226. package/dist/src/formats/json/positions.js +20 -4
  227. package/dist/src/formats/json/positions.js.map +1 -1
  228. package/dist/src/formats/json/styles.d.ts +12 -1
  229. package/dist/src/formats/json/styles.d.ts.map +1 -1
  230. package/dist/src/formats/json/styles.js +1843 -136
  231. package/dist/src/formats/json/styles.js.map +1 -1
  232. package/dist/src/formats/pajek/draw.d.ts +104 -0
  233. package/dist/src/formats/pajek/draw.d.ts.map +1 -0
  234. package/dist/src/formats/pajek/draw.js +382 -0
  235. package/dist/src/formats/pajek/draw.js.map +1 -0
  236. package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
  237. package/dist/src/formats/pajek/exporter.js +70 -51
  238. package/dist/src/formats/pajek/exporter.js.map +1 -1
  239. package/dist/src/formats/pajek/importer.d.ts +9 -0
  240. package/dist/src/formats/pajek/importer.d.ts.map +1 -1
  241. package/dist/src/formats/pajek/importer.js +233 -102
  242. package/dist/src/formats/pajek/importer.js.map +1 -1
  243. package/dist/src/formats/pajek/index.d.ts +1 -0
  244. package/dist/src/formats/pajek/index.d.ts.map +1 -1
  245. package/dist/src/formats/pajek/index.js.map +1 -1
  246. package/dist/src/formats/pajek/styles.d.ts +15 -7
  247. package/dist/src/formats/pajek/styles.d.ts.map +1 -1
  248. package/dist/src/formats/pajek/styles.js +1395 -114
  249. package/dist/src/formats/pajek/styles.js.map +1 -1
  250. package/dist/src/formats/pajek/syntax.d.ts +10 -1
  251. package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
  252. package/dist/src/formats/pajek/syntax.js +26 -2
  253. package/dist/src/formats/pajek/syntax.js.map +1 -1
  254. package/dist/src/formats/xgmml/emit.d.ts +1 -0
  255. package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
  256. package/dist/src/formats/xgmml/emit.js +65 -5
  257. package/dist/src/formats/xgmml/emit.js.map +1 -1
  258. package/dist/src/formats/xgmml/styles.d.ts +23 -3
  259. package/dist/src/formats/xgmml/styles.d.ts.map +1 -1
  260. package/dist/src/formats/xgmml/styles.js +277 -60
  261. package/dist/src/formats/xgmml/styles.js.map +1 -1
  262. package/dist/src/index.d.ts +6 -5
  263. package/dist/src/index.d.ts.map +1 -1
  264. package/dist/src/index.js +6 -5
  265. package/dist/src/index.js.map +1 -1
  266. package/dist/src/positions/convert.d.ts.map +1 -1
  267. package/dist/src/positions/convert.js +11 -1
  268. package/dist/src/positions/convert.js.map +1 -1
  269. package/dist/src/positions/extract.d.ts.map +1 -1
  270. package/dist/src/positions/extract.js +53 -1
  271. package/dist/src/positions/extract.js.map +1 -1
  272. package/dist/src/positions/index.d.ts +1 -1
  273. package/dist/src/positions/index.d.ts.map +1 -1
  274. package/dist/src/positions/types.d.ts +59 -0
  275. package/dist/src/positions/types.d.ts.map +1 -1
  276. package/dist/src/sources/builtins.d.ts +1 -1
  277. package/dist/src/sources/builtins.d.ts.map +1 -1
  278. package/dist/src/sources/builtins.js +8 -2
  279. package/dist/src/sources/builtins.js.map +1 -1
  280. package/dist/src/sources/context.d.ts.map +1 -1
  281. package/dist/src/sources/context.js +1 -0
  282. package/dist/src/sources/context.js.map +1 -1
  283. package/dist/src/sources/credentials.d.ts +50 -1
  284. package/dist/src/sources/credentials.d.ts.map +1 -1
  285. package/dist/src/sources/credentials.js +69 -0
  286. package/dist/src/sources/credentials.js.map +1 -1
  287. package/dist/src/sources/cypher/descriptor.d.ts.map +1 -1
  288. package/dist/src/sources/cypher/descriptor.js +5 -0
  289. package/dist/src/sources/cypher/descriptor.js.map +1 -1
  290. package/dist/src/sources/cypher/index.d.ts.map +1 -1
  291. package/dist/src/sources/cypher/index.js +125 -18
  292. package/dist/src/sources/cypher/index.js.map +1 -1
  293. package/dist/src/sources/cypher/params.d.ts +1 -1
  294. package/dist/src/sources/cypher/params.d.ts.map +1 -1
  295. package/dist/src/sources/cypher/query-builder.d.ts +17 -0
  296. package/dist/src/sources/cypher/query-builder.d.ts.map +1 -1
  297. package/dist/src/sources/cypher/query-builder.js +31 -0
  298. package/dist/src/sources/cypher/query-builder.js.map +1 -1
  299. package/dist/src/sources/ids.d.ts +5 -0
  300. package/dist/src/sources/ids.d.ts.map +1 -1
  301. package/dist/src/sources/ids.js +5 -0
  302. package/dist/src/sources/ids.js.map +1 -1
  303. package/dist/src/sources/params.d.ts +3 -0
  304. package/dist/src/sources/params.d.ts.map +1 -1
  305. package/dist/src/sources/rest/descriptor.d.ts.map +1 -1
  306. package/dist/src/sources/rest/descriptor.js +9 -0
  307. package/dist/src/sources/rest/descriptor.js.map +1 -1
  308. package/dist/src/sources/rest/openalex.d.ts +4 -2
  309. package/dist/src/sources/rest/openalex.d.ts.map +1 -1
  310. package/dist/src/sources/rest/openalex.js +4 -2
  311. package/dist/src/sources/rest/openalex.js.map +1 -1
  312. package/dist/src/sources/rest/source.d.ts.map +1 -1
  313. package/dist/src/sources/rest/source.js +38 -0
  314. package/dist/src/sources/rest/source.js.map +1 -1
  315. package/dist/src/sources/run.d.ts +2 -0
  316. package/dist/src/sources/run.d.ts.map +1 -1
  317. package/dist/src/sources/run.js +30 -3
  318. package/dist/src/sources/run.js.map +1 -1
  319. package/dist/src/sources/sigv4.d.ts +5 -3
  320. package/dist/src/sources/sigv4.d.ts.map +1 -1
  321. package/dist/src/sources/sigv4.js +6 -4
  322. package/dist/src/sources/sigv4.js.map +1 -1
  323. package/dist/src/sources/sparql/descriptor.d.ts +10 -0
  324. package/dist/src/sources/sparql/descriptor.d.ts.map +1 -0
  325. package/dist/src/sources/sparql/descriptor.js +64 -0
  326. package/dist/src/sources/sparql/descriptor.js.map +1 -0
  327. package/dist/src/sources/sparql/index.d.ts +28 -0
  328. package/dist/src/sources/sparql/index.d.ts.map +1 -0
  329. package/dist/src/sources/sparql/index.js +327 -0
  330. package/dist/src/sources/sparql/index.js.map +1 -0
  331. package/dist/src/sources/sparql/ntriples.d.ts +69 -0
  332. package/dist/src/sources/sparql/ntriples.d.ts.map +1 -0
  333. package/dist/src/sources/sparql/ntriples.js +180 -0
  334. package/dist/src/sources/sparql/ntriples.js.map +1 -0
  335. package/dist/src/sources/sparql/params.d.ts +27 -0
  336. package/dist/src/sources/sparql/params.d.ts.map +1 -0
  337. package/dist/src/sources/sparql/params.js +5 -0
  338. package/dist/src/sources/sparql/params.js.map +1 -0
  339. package/dist/src/sources/sparql/query.d.ts +73 -0
  340. package/dist/src/sources/sparql/query.d.ts.map +1 -0
  341. package/dist/src/sources/sparql/query.js +164 -0
  342. package/dist/src/sources/sparql/query.js.map +1 -0
  343. package/dist/src/sources/types.d.ts +60 -0
  344. package/dist/src/sources/types.d.ts.map +1 -1
  345. package/dist/src/styles/annotations.d.ts +61 -5
  346. package/dist/src/styles/annotations.d.ts.map +1 -1
  347. package/dist/src/styles/annotations.js +130 -22
  348. package/dist/src/styles/annotations.js.map +1 -1
  349. package/dist/src/styles/canon/bends.d.ts +46 -0
  350. package/dist/src/styles/canon/bends.d.ts.map +1 -1
  351. package/dist/src/styles/canon/bends.js +123 -0
  352. package/dist/src/styles/canon/bends.js.map +1 -1
  353. package/dist/src/styles/canon/color-tables.d.ts +6 -1
  354. package/dist/src/styles/canon/color-tables.d.ts.map +1 -1
  355. package/dist/src/styles/canon/color-tables.js +10 -4
  356. package/dist/src/styles/canon/color-tables.js.map +1 -1
  357. package/dist/src/styles/canon/color.d.ts +3 -1
  358. package/dist/src/styles/canon/color.d.ts.map +1 -1
  359. package/dist/src/styles/canon/color.js +103 -3
  360. package/dist/src/styles/canon/color.js.map +1 -1
  361. package/dist/src/styles/canon/enums.d.ts +2 -2
  362. package/dist/src/styles/canon/enums.d.ts.map +1 -1
  363. package/dist/src/styles/canon/enums.js +89 -7
  364. package/dist/src/styles/canon/enums.js.map +1 -1
  365. package/dist/src/styles/canon/graphviz.d.ts +12 -3
  366. package/dist/src/styles/canon/graphviz.d.ts.map +1 -1
  367. package/dist/src/styles/canon/graphviz.js +57 -9
  368. package/dist/src/styles/canon/graphviz.js.map +1 -1
  369. package/dist/src/styles/canon/number.d.ts +8 -0
  370. package/dist/src/styles/canon/number.d.ts.map +1 -1
  371. package/dist/src/styles/canon/number.js +18 -0
  372. package/dist/src/styles/canon/number.js.map +1 -1
  373. package/dist/src/styles/canon/text.d.ts +29 -2
  374. package/dist/src/styles/canon/text.d.ts.map +1 -1
  375. package/dist/src/styles/canon/text.js +156 -16
  376. package/dist/src/styles/canon/text.js.map +1 -1
  377. package/dist/src/styles/codes.d.ts +2 -0
  378. package/dist/src/styles/codes.d.ts.map +1 -1
  379. package/dist/src/styles/codes.js +2 -0
  380. package/dist/src/styles/codes.js.map +1 -1
  381. package/dist/src/styles/cyjs/cascade.d.ts.map +1 -1
  382. package/dist/src/styles/cyjs/cascade.js +1139 -79
  383. package/dist/src/styles/cyjs/cascade.js.map +1 -1
  384. package/dist/src/styles/cyjs/defaults-table.d.ts.map +1 -1
  385. package/dist/src/styles/cyjs/defaults-table.js +4 -0
  386. package/dist/src/styles/cyjs/defaults-table.js.map +1 -1
  387. package/dist/src/styles/cyjs/emit.d.ts.map +1 -1
  388. package/dist/src/styles/cyjs/emit.js +232 -10
  389. package/dist/src/styles/cyjs/emit.js.map +1 -1
  390. package/dist/src/styles/cyjs/face.d.ts +20 -0
  391. package/dist/src/styles/cyjs/face.d.ts.map +1 -0
  392. package/dist/src/styles/cyjs/face.js +332 -0
  393. package/dist/src/styles/cyjs/face.js.map +1 -0
  394. package/dist/src/styles/cyjs/mappers.d.ts +44 -1
  395. package/dist/src/styles/cyjs/mappers.d.ts.map +1 -1
  396. package/dist/src/styles/cyjs/mappers.js +475 -26
  397. package/dist/src/styles/cyjs/mappers.js.map +1 -1
  398. package/dist/src/styles/cyjs/routes.d.ts +53 -0
  399. package/dist/src/styles/cyjs/routes.d.ts.map +1 -0
  400. package/dist/src/styles/cyjs/routes.js +360 -0
  401. package/dist/src/styles/cyjs/routes.js.map +1 -0
  402. package/dist/src/styles/cytoscape/charts.d.ts +23 -0
  403. package/dist/src/styles/cytoscape/charts.d.ts.map +1 -0
  404. package/dist/src/styles/cytoscape/charts.js +560 -0
  405. package/dist/src/styles/cytoscape/charts.js.map +1 -0
  406. package/dist/src/styles/cytoscape/emit.d.ts.map +1 -1
  407. package/dist/src/styles/cytoscape/emit.js +156 -48
  408. package/dist/src/styles/cytoscape/emit.js.map +1 -1
  409. package/dist/src/styles/cytoscape/lexicon.d.ts +91 -3
  410. package/dist/src/styles/cytoscape/lexicon.d.ts.map +1 -1
  411. package/dist/src/styles/cytoscape/lexicon.js +387 -77
  412. package/dist/src/styles/cytoscape/lexicon.js.map +1 -1
  413. package/dist/src/styles/cytoscape/mappings.d.ts +30 -0
  414. package/dist/src/styles/cytoscape/mappings.d.ts.map +1 -1
  415. package/dist/src/styles/cytoscape/mappings.js +92 -0
  416. package/dist/src/styles/cytoscape/mappings.js.map +1 -1
  417. package/dist/src/styles/cytoscape/resolve.d.ts +42 -2
  418. package/dist/src/styles/cytoscape/resolve.d.ts.map +1 -1
  419. package/dist/src/styles/cytoscape/resolve.js +623 -17
  420. package/dist/src/styles/cytoscape/resolve.js.map +1 -1
  421. package/dist/src/styles/defaults.d.ts +46 -26
  422. package/dist/src/styles/defaults.d.ts.map +1 -1
  423. package/dist/src/styles/defaults.js +308 -71
  424. package/dist/src/styles/defaults.js.map +1 -1
  425. package/dist/src/styles/index.d.ts +4 -3
  426. package/dist/src/styles/index.d.ts.map +1 -1
  427. package/dist/src/styles/index.js +3 -2
  428. package/dist/src/styles/index.js.map +1 -1
  429. package/dist/src/styles/internal.d.ts +1 -0
  430. package/dist/src/styles/internal.d.ts.map +1 -1
  431. package/dist/src/styles/internal.js +1 -0
  432. package/dist/src/styles/internal.js.map +1 -1
  433. package/dist/src/styles/io/generic.d.ts.map +1 -1
  434. package/dist/src/styles/io/generic.js +56 -16
  435. package/dist/src/styles/io/generic.js.map +1 -1
  436. package/dist/src/styles/io/round-trip.d.ts +56 -0
  437. package/dist/src/styles/io/round-trip.d.ts.map +1 -0
  438. package/dist/src/styles/io/round-trip.js +138 -0
  439. package/dist/src/styles/io/round-trip.js.map +1 -0
  440. package/dist/src/styles/io/writer.d.ts.map +1 -1
  441. package/dist/src/styles/io/writer.js +6 -1
  442. package/dist/src/styles/io/writer.js.map +1 -1
  443. package/dist/src/styles/notes.d.ts.map +1 -1
  444. package/dist/src/styles/notes.js +1 -0
  445. package/dist/src/styles/notes.js.map +1 -1
  446. package/dist/src/styles/plan/features.d.ts +1 -1
  447. package/dist/src/styles/plan/features.d.ts.map +1 -1
  448. package/dist/src/styles/plan/features.js +22 -2
  449. package/dist/src/styles/plan/features.js.map +1 -1
  450. package/dist/src/styles/plan/index.d.ts +1 -1
  451. package/dist/src/styles/plan/index.d.ts.map +1 -1
  452. package/dist/src/styles/plan/index.js +1 -1
  453. package/dist/src/styles/plan/index.js.map +1 -1
  454. package/dist/src/styles/plan/plan.d.ts.map +1 -1
  455. package/dist/src/styles/plan/plan.js +61 -4
  456. package/dist/src/styles/plan/plan.js.map +1 -1
  457. package/dist/src/styles/plan/resolve.d.ts +11 -0
  458. package/dist/src/styles/plan/resolve.d.ts.map +1 -1
  459. package/dist/src/styles/plan/resolve.js +40 -4
  460. package/dist/src/styles/plan/resolve.js.map +1 -1
  461. package/dist/src/styles/slots.d.ts +14 -0
  462. package/dist/src/styles/slots.d.ts.map +1 -0
  463. package/dist/src/styles/slots.js +20 -0
  464. package/dist/src/styles/slots.js.map +1 -0
  465. package/dist/src/styles/types.d.ts +687 -6
  466. package/dist/src/styles/types.d.ts.map +1 -1
  467. package/dist/src/styles/vocabulary.d.ts +3 -2
  468. package/dist/src/styles/vocabulary.d.ts.map +1 -1
  469. package/dist/src/styles/vocabulary.js +224 -0
  470. package/dist/src/styles/vocabulary.js.map +1 -1
  471. package/dist/styles.js +30 -239
  472. package/dist/styles.js.map +1 -1
  473. package/dist/xgmml.js +3 -3
  474. package/package.json +27 -7
  475. package/src/formats/cx/importer.ts +6 -1
  476. package/src/formats/cx/styles.ts +143 -9
  477. package/src/formats/cx2/importer.ts +1 -0
  478. package/src/formats/cx2/styles.ts +3 -1
  479. package/src/formats/cys/importer.ts +1 -0
  480. package/src/formats/cys/styles.ts +27 -5
  481. package/src/formats/dot/drawing.ts +799 -0
  482. package/src/formats/dot/exporter.ts +37 -1
  483. package/src/formats/dot/importer.ts +192 -36
  484. package/src/formats/dot/index.ts +3 -1
  485. package/src/formats/dot/label-places.ts +241 -0
  486. package/src/formats/dot/names.ts +15 -0
  487. package/src/formats/dot/record.ts +336 -0
  488. package/src/formats/dot/styles.ts +1702 -149
  489. package/src/formats/gexf/dialog-metrics.ts +61 -0
  490. package/src/formats/gexf/importer.ts +50 -5
  491. package/src/formats/gexf/preview.ts +217 -0
  492. package/src/formats/gexf/schema.ts +2 -1
  493. package/src/formats/gexf/styles.ts +1099 -245
  494. package/src/formats/gml/importer.ts +291 -76
  495. package/src/formats/gml/index.ts +1 -1
  496. package/src/formats/gml/positions.ts +29 -7
  497. package/src/formats/gml/styles.ts +852 -110
  498. package/src/formats/graphml/styles-plain.ts +6 -15
  499. package/src/formats/graphml/styles-yed.ts +765 -176
  500. package/src/formats/graphml/styles-yfiles3.ts +487 -63
  501. package/src/formats/graphml/yfiles.ts +19 -6
  502. package/src/formats/json/dialect.ts +41 -5
  503. package/src/formats/json/importer.ts +59 -7
  504. package/src/formats/json/index.ts +1 -0
  505. package/src/formats/json/positions.ts +22 -5
  506. package/src/formats/json/styles.ts +2123 -171
  507. package/src/formats/pajek/draw.ts +469 -0
  508. package/src/formats/pajek/exporter.ts +81 -49
  509. package/src/formats/pajek/importer.ts +278 -103
  510. package/src/formats/pajek/index.ts +1 -0
  511. package/src/formats/pajek/styles.ts +1506 -133
  512. package/src/formats/pajek/syntax.ts +27 -2
  513. package/src/formats/xgmml/emit.ts +73 -5
  514. package/src/formats/xgmml/styles.ts +330 -71
  515. package/src/index.ts +12 -1
  516. package/src/positions/convert.ts +12 -1
  517. package/src/positions/extract.ts +55 -1
  518. package/src/positions/index.ts +1 -0
  519. package/src/positions/types.ts +60 -0
  520. package/src/sources/builtins.ts +8 -1
  521. package/src/sources/context.ts +1 -0
  522. package/src/sources/credentials.ts +90 -1
  523. package/src/sources/cypher/descriptor.ts +7 -1
  524. package/src/sources/cypher/index.ts +149 -18
  525. package/src/sources/cypher/params.ts +1 -1
  526. package/src/sources/cypher/query-builder.ts +33 -0
  527. package/src/sources/ids.ts +6 -0
  528. package/src/sources/params.ts +3 -0
  529. package/src/sources/rest/descriptor.ts +9 -0
  530. package/src/sources/rest/openalex.ts +4 -2
  531. package/src/sources/rest/source.ts +41 -0
  532. package/src/sources/run.ts +35 -3
  533. package/src/sources/sigv4.ts +6 -4
  534. package/src/sources/sparql/descriptor.ts +67 -0
  535. package/src/sources/sparql/index.ts +371 -0
  536. package/src/sources/sparql/ntriples.ts +219 -0
  537. package/src/sources/sparql/params.ts +28 -0
  538. package/src/sources/sparql/query.ts +216 -0
  539. package/src/sources/types.ts +68 -0
  540. package/src/styles/annotations.ts +201 -27
  541. package/src/styles/canon/bends.ts +137 -0
  542. package/src/styles/canon/color-tables.ts +10 -4
  543. package/src/styles/canon/color.ts +105 -3
  544. package/src/styles/canon/enums.ts +107 -8
  545. package/src/styles/canon/graphviz.ts +71 -10
  546. package/src/styles/canon/number.ts +19 -0
  547. package/src/styles/canon/text.ts +187 -16
  548. package/src/styles/codes.ts +2 -0
  549. package/src/styles/cyjs/cascade.ts +1303 -84
  550. package/src/styles/cyjs/defaults-table.ts +4 -0
  551. package/src/styles/cyjs/emit.ts +268 -14
  552. package/src/styles/cyjs/face.ts +372 -0
  553. package/src/styles/cyjs/mappers.ts +506 -27
  554. package/src/styles/cyjs/routes.ts +432 -0
  555. package/src/styles/cytoscape/charts.ts +684 -0
  556. package/src/styles/cytoscape/emit.ts +170 -48
  557. package/src/styles/cytoscape/lexicon.ts +431 -78
  558. package/src/styles/cytoscape/mappings.ts +108 -0
  559. package/src/styles/cytoscape/resolve.ts +741 -17
  560. package/src/styles/defaults.ts +417 -108
  561. package/src/styles/index.ts +5 -0
  562. package/src/styles/internal.ts +1 -0
  563. package/src/styles/io/generic.ts +79 -23
  564. package/src/styles/io/round-trip.ts +202 -0
  565. package/src/styles/io/writer.ts +6 -1
  566. package/src/styles/notes.ts +1 -0
  567. package/src/styles/plan/features.ts +23 -2
  568. package/src/styles/plan/index.ts +1 -1
  569. package/src/styles/plan/plan.ts +69 -5
  570. package/src/styles/plan/resolve.ts +47 -4
  571. package/src/styles/slots.ts +25 -0
  572. package/src/styles/types.ts +698 -5
  573. package/src/styles/vocabulary.ts +232 -2
  574. package/dist/chunks/block-Cu22ewuS.js.map +0 -1
  575. package/dist/chunks/choose-Cdx6Enl2.js +0 -57
  576. package/dist/chunks/choose-Cdx6Enl2.js.map +0 -1
  577. package/dist/chunks/codes-CV_Bhcyi.js.map +0 -1
  578. package/dist/chunks/convert-BcQ8_jMo.js.map +0 -1
  579. package/dist/chunks/credentials-BiQsnMTb.js.map +0 -1
  580. package/dist/chunks/descriptor-BJ-W0Jd-.js.map +0 -1
  581. package/dist/chunks/emit-CD8xnY8s.js.map +0 -1
  582. package/dist/chunks/export-CZ7VRm4I.js.map +0 -1
  583. package/dist/chunks/exporter-bxxjOrDZ.js.map +0 -1
  584. package/dist/chunks/format-BMS-1Nxb.js +0 -64
  585. package/dist/chunks/format-BMS-1Nxb.js.map +0 -1
  586. package/dist/chunks/generic-CP6YD34u.js.map +0 -1
  587. package/dist/chunks/importer-B87_fmVx.js.map +0 -1
  588. package/dist/chunks/importer-CB_zV5_L.js.map +0 -1
  589. package/dist/chunks/importer-CVT-JyDE.js.map +0 -1
  590. package/dist/chunks/importer-Cyy6UseH.js.map +0 -1
  591. package/dist/chunks/importer-DPZDN40-.js.map +0 -1
  592. package/dist/chunks/importer-e3huMZbm.js.map +0 -1
  593. package/dist/chunks/lexicon-u2SI5xcx.js.map +0 -1
  594. package/dist/chunks/sigv4-LkAzsLAu.js.map +0 -1
  595. package/dist/chunks/styles-CaABMoO1.js.map +0 -1
  596. package/dist/chunks/styles-P_gmFAOi.js +0 -770
  597. package/dist/chunks/styles-P_gmFAOi.js.map +0 -1
  598. package/dist/chunks/styles-yed-Cs1nmrjn.js.map +0 -1
  599. package/dist/chunks/writer-DvHTl36J.js +0 -449
  600. package/dist/chunks/writer-DvHTl36J.js.map +0 -1
@@ -1,449 +0,0 @@
1
- import { p as plural, a as agree } from "./report-CgdsL9Hb.js";
2
- import { s as styleFingerprint, a as STYLE_ISSUE, b as styleTag, w as writeStyleBlock, c as styleBlockLosses, r as resolveStyles, S as STYLE_BLOCK_NAME, d as canonicalFor, e as degreeValues, f as dataCell, t as toolDefaults, p as plainCell } from "./block-Cu22ewuS.js";
3
- const STYLE_ROLES = /* @__PURE__ */ new Set(["color", "size", "shape", "thickness", "hidden"]);
4
- const TARGETS = ["node", "edge"];
5
- function prepareStyleExport(snapshot, exporter, given, plain) {
6
- const fp = styleFingerprint(snapshot);
7
- const want = given.fingerprint;
8
- if (fp.nodes !== want.nodes || fp.edges !== want.edges || fp.ids !== want.ids) {
9
- return {
10
- snapshot,
11
- input: null,
12
- notes: [],
13
- refusal: Object.freeze({
14
- code: STYLE_ISSUE.MISMATCH,
15
- message: `the styles were read from or built for a different graph (${String(want.nodes)} nodes and ${String(want.edges)} edges, this graph has ${String(fp.nodes)} and ${String(fp.edges)}, or other node ids); nothing is written`,
16
- column: null,
17
- count: null
18
- })
19
- };
20
- }
21
- const caps = exporter.styles?.capabilities ?? null;
22
- let plan = writePlan(snapshot, exporter, given);
23
- if (keepsStyleBlock(exporter)) {
24
- let checked;
25
- try {
26
- checked = exporter.check(plan.snapshot, plan.input === null ? plain : { ...plain, styles: plan.input });
27
- } catch {
28
- checked = [];
29
- }
30
- const carried = withLostInputsCarried(given, snapshot, checked);
31
- if (carried !== given) {
32
- plan = writePlan(snapshot, exporter, carried);
33
- }
34
- }
35
- return {
36
- snapshot: plan.snapshot,
37
- input: plan.input,
38
- notes: lossNotes(plan.extracted, exporter, caps, plan.picture, snapshot),
39
- refusal: null
40
- };
41
- }
42
- const CALL_WORK = /* @__PURE__ */ new WeakMap();
43
- function sharedInExportCall(input, key, compute) {
44
- if (!CALL_WORK.has(input)) {
45
- return compute();
46
- }
47
- const done = CALL_WORK.get(input);
48
- if (done?.key.length === key.length && done.key.every((k, i) => k === key[i])) {
49
- return done.value;
50
- }
51
- const value = compute();
52
- CALL_WORK.set(input, { key, value });
53
- return value;
54
- }
55
- function writePlan(snapshot, exporter, extracted) {
56
- const caps = exporter.styles?.capabilities ?? null;
57
- const pictures = /* @__PURE__ */ new Map();
58
- const picture = (target, property) => {
59
- const key = `${target}\0${property}`;
60
- let values = pictures.get(key);
61
- if (values === void 0) {
62
- values = resolveStyles(extracted, target, property, snapshot);
63
- pictures.set(key, values);
64
- }
65
- return values;
66
- };
67
- const tags = { node: /* @__PURE__ */ new Map(), edge: /* @__PURE__ */ new Map() };
68
- for (const target of TARGETS) {
69
- for (const [key, col] of extracted.columns[target]) {
70
- tags[target].set(styleTag(target, key), col);
71
- }
72
- }
73
- const block = writeStyleBlock(extracted, { snapshot });
74
- const input = exporter.styles === void 0 ? null : { picture, block, tags, rules: extracted };
75
- if (input !== null) {
76
- CALL_WORK.set(input, null);
77
- }
78
- return {
79
- snapshot: styledSnapshot(snapshot, caps, tags, block, extracted.styles.rules),
80
- input,
81
- extracted,
82
- picture
83
- };
84
- }
85
- const VALUES_KEPT = /NODE_TABLE|NAME_CHANGED|ROLE_ASSUMED|STORAGE_CLASS|NUMBER_TYPE|INTEGRAL|WIDENED/;
86
- function withLostInputsCarried(extracted, snapshot, notes) {
87
- const lost = /* @__PURE__ */ new Set();
88
- let direction = false;
89
- for (const note of notes) {
90
- if (!VALUES_KEPT.test(note.code)) {
91
- for (const name of note.columns ?? (note.column === null ? [] : [note.column])) {
92
- lost.add(name);
93
- }
94
- }
95
- direction ||= /DIRECTION/.test(note.code);
96
- }
97
- const carrier = new LostInputs(snapshot, lost, direction, extracted.columns);
98
- const rules = extracted.styles.rules.map((rule) => carrier.carry(rule));
99
- const changed = rules.some((rule, i) => rule !== extracted.styles.rules[i]);
100
- return changed ? { ...extracted, styles: { ...extracted.styles, rules }, columns: carrier.columns } : extracted;
101
- }
102
- class LostInputs {
103
- /**
104
- * A carrier for one export.
105
- * @param snapshot - the graph
106
- * @param lost - the data columns the export drops or changes
107
- * @param direction - whether the file loses the edges' direction (and so the in and out degrees)
108
- * @param columns - the styles' own style columns
109
- * @param columns.node - the node columns
110
- * @param columns.edge - the edge columns
111
- */
112
- constructor(snapshot, lost, direction, columns) {
113
- this.snapshot = snapshot;
114
- this.lost = lost;
115
- this.direction = direction;
116
- this.touched = false;
117
- this.columns = { node: new Map(columns.node), edge: new Map(columns.edge) };
118
- }
119
- /**
120
- * A rule with every lost input it reads replaced by a copy of its values.
121
- * @param rule - the rule
122
- * @returns the rule read from copies, or the rule itself when it reads no lost input
123
- */
124
- carry(rule) {
125
- this.touched = false;
126
- const { ext, ...given } = rule;
127
- const map = this.carryMap(rule);
128
- const where = this.walk(rule, given.where);
129
- if (!this.touched) {
130
- return rule;
131
- }
132
- const { map: _given, ...unmapped } = given;
133
- const plain = Object.keys(map).length === 0 ? { ...unmapped, where } : { ...unmapped, where, map };
134
- const moved = JSON.parse(JSON.stringify(plain));
135
- return ext === void 0 ? moved : { ...moved, ext };
136
- }
137
- /**
138
- * A rule's mappings with their lost inputs replaced. A passthrough reads a data column as the property's value: its
139
- * copy holds those values; one that gives no element a value (a list, text that is not a color) is left out, so
140
- * no other value the file reads back in the column (a list written as text) is given either.
141
- * @param rule - the rule
142
- * @returns the mappings
143
- */
144
- carryMap(rule) {
145
- const map = /* @__PURE__ */ Object.create(null);
146
- const { table } = this.tableOf(rule.target);
147
- for (const [property, mapping] of Object.entries(rule.map ?? {})) {
148
- if (mapping === void 0) {
149
- continue;
150
- }
151
- if (mapping.kind !== "passthrough") {
152
- map[property] = this.walk(rule, mapping);
153
- continue;
154
- }
155
- const name = mapping.by.data;
156
- const lostColumn = typeof name === "string" && this.lost.has(name) && table.has(name);
157
- const values = lostColumn ? this.cells(rule.target, name, canonicalFor(rule.target, property)) : null;
158
- if (values !== null && !values.some((v) => v !== null)) {
159
- this.touched = true;
160
- } else if (values !== null && this.isLost(rule.target, name)) {
161
- this.touched = true;
162
- map[property] = { ...mapping, by: this.copy(rule.target, `${property}.data.${name}`, () => values) };
163
- } else {
164
- map[property] = mapping;
165
- }
166
- }
167
- return map;
168
- }
169
- /**
170
- * A value with every other reference to a lost input reading a copy of its values as they are.
171
- * @param rule - the rule it belongs to
172
- * @param value - the value
173
- * @returns the value, references replaced
174
- */
175
- walk(rule, value) {
176
- return JSON.parse(JSON.stringify(value, (_k, v) => this.replaced(rule, v)));
177
- }
178
- /**
179
- * One reference with a lost input replaced by its copy: a data column, or a degree the file does not keep.
180
- * @param rule - the rule it belongs to
181
- * @param v - a value of the rule
182
- * @returns the value, or the reference to the copy
183
- */
184
- replaced(rule, v) {
185
- if (typeof v !== "object" || v === null || Array.isArray(v) || Object.keys(v).length !== 1) {
186
- return v;
187
- }
188
- const ref = v;
189
- if (this.isLost(rule.target, ref.data)) {
190
- const name = ref.data;
191
- this.touched = true;
192
- return this.copy(
193
- rule.target,
194
- `data.${name}`,
195
- () => this.cells(rule.target, name, (raw) => isStyleScalar(raw) ? raw : null)
196
- );
197
- }
198
- const which = ref.computed;
199
- if ((which === "indegree" || which === "outdegree") && this.direction && rule.target === "node") {
200
- this.touched = true;
201
- return this.copy(rule.target, `computed.${which}`, () => degreeValues(this.snapshot, which));
202
- }
203
- return v;
204
- }
205
- /**
206
- * The reference to a copy of an input, made on first use and shared by every rule that reads it.
207
- * @param target - nodes or edges
208
- * @param base - what is copied
209
- * @param values - its values
210
- * @returns the reference
211
- */
212
- copy(target, base, values) {
213
- const key = `input.${base}`;
214
- const held = this.columns[target];
215
- if (!held.has(key)) {
216
- held.set(key, values());
217
- }
218
- return { style: key };
219
- }
220
- /**
221
- * Whether a name is a lost input that can be copied: only a column of plain values can, and a list, or a column with
222
- * no value, stays as it is.
223
- * @param target - nodes or edges
224
- * @param name - the name
225
- * @returns true for a lost input
226
- */
227
- isLost(target, name) {
228
- const { table, n } = this.tableOf(target);
229
- return typeof name === "string" && this.lost.has(name) && table.has(name) && carriable(table, n, name);
230
- }
231
- /**
232
- * Every element's value of a data column.
233
- * @param target - nodes or edges
234
- * @param name - the column
235
- * @param read - the value of a cell
236
- * @returns the values
237
- */
238
- cells(target, name, read) {
239
- const { table, n } = this.tableOf(target);
240
- return Array.from({ length: n }, (_u, i) => read(dataCell(table, name, i)));
241
- }
242
- /**
243
- * A target's table and row count.
244
- * @param target - nodes or edges
245
- * @returns the table and its row count
246
- */
247
- tableOf(target) {
248
- const { snapshot } = this;
249
- return target === "node" ? { table: snapshot.nodes, n: snapshot.nodeCount } : { table: snapshot.edges, n: snapshot.edgeCount };
250
- }
251
- }
252
- function carriable(table, n, name) {
253
- let some = false;
254
- for (let i = 0; i < n; i++) {
255
- const cell = plainCell(table.value(name, i));
256
- if (cell !== null && cell !== void 0) {
257
- if (!isStyleScalar(cell)) {
258
- return false;
259
- }
260
- some = true;
261
- }
262
- }
263
- return some;
264
- }
265
- function isStyleScalar(v) {
266
- return typeof v === "string" || typeof v === "boolean" || typeof v === "number" && Number.isFinite(v);
267
- }
268
- function keepsStyleBlock(exporter) {
269
- const caps = exporter.styles?.capabilities;
270
- return caps !== void 0 && (caps.block === "native" || caps.block === "attributes" && exporter.capabilities.graphAttributes);
271
- }
272
- function isKeptGraphtyProperty(note, exporter) {
273
- return note.style?.property.startsWith("graphty:") === true && keepsStyleBlock(exporter);
274
- }
275
- function lossNotes(extracted, exporter, caps, picture, snapshot) {
276
- const notes = [];
277
- const kept = keepsStyleBlock(exporter);
278
- for (const target of TARGETS) {
279
- const written = new Set(caps?.[target] ?? []);
280
- for (const property of ruleProperties(extracted.styles.rules, target)) {
281
- if (written.has(property) || kept && property.startsWith("graphty:")) {
282
- if (target === "edge") {
283
- notes.push(...pairNotes(snapshot, exporter, property, picture("edge", property)));
284
- }
285
- } else {
286
- notes.push(notWrittenNote(target, property, exporter, picture));
287
- }
288
- }
289
- }
290
- notes.push(...graphLossNotes(extracted, exporter, caps));
291
- if (kept) {
292
- notes.push(...styleBlockLosses(writeStyleBlock(extracted, { snapshot }), extracted.styles.rules.length));
293
- } else if (extracted.styles.rules.length > 0) {
294
- notes.push(
295
- Object.freeze({
296
- code: STYLE_ISSUE.RULES_NOT_KEPT,
297
- message: `the style rules are not kept: the ${exporter.format} format has no place for them; importing the file infers them again from what it holds`,
298
- column: null,
299
- count: extracted.styles.rules.length
300
- })
301
- );
302
- }
303
- return notes;
304
- }
305
- function graphLossNotes(extracted, exporter, caps) {
306
- const graphWritten = new Set(caps?.graph ?? []);
307
- const drawn = (caps?.tool === void 0 ? null : toolDefaults(caps.tool))?.graph ?? {};
308
- return Object.entries(extracted.styles.graph).filter(([property, value]) => !graphWritten.has(property) && drawn[property]?.value !== value).map(([property]) => property).map(
309
- (property) => Object.freeze({
310
- code: STYLE_ISSUE.NOT_WRITTEN,
311
- message: `the graph's ${property} is not written: the ${exporter.format} format has no place for it`,
312
- column: null,
313
- count: 1,
314
- style: Object.freeze({ target: "graph", property })
315
- })
316
- );
317
- }
318
- function ruleProperties(rules, target) {
319
- return new Set(
320
- rules.filter((rule) => rule.target === target).flatMap((rule) => [...Object.keys(rule.set ?? {}), ...Object.keys(rule.map ?? {})])
321
- );
322
- }
323
- function notWrittenNote(target, property, exporter, picture) {
324
- const count = picture(target, property).filter((v) => v !== null).length;
325
- return Object.freeze({
326
- code: STYLE_ISSUE.NOT_WRITTEN,
327
- message: `${target} ${property} is not written: the ${exporter.format} format has no place for it (${String(count)} ${target}${plural(count)} ${agree(count, "has", "have")} a value)`,
328
- column: null,
329
- count,
330
- style: Object.freeze({ target, property })
331
- });
332
- }
333
- function pairNotes(snapshot, exporter, property, values) {
334
- const pair = snapshot.edges.byRole("pair");
335
- let count = 0;
336
- for (let i = 0; pair !== null && i < values.length; i++) {
337
- const other = pair.isSet(i) ? pair.value(i) : i;
338
- if (other < i && values[i] !== values[other]) {
339
- count++;
340
- }
341
- }
342
- if (count === 0) {
343
- return [];
344
- }
345
- return [
346
- Object.freeze({
347
- code: STYLE_ISSUE.APPROXIMATED,
348
- message: `edge ${property}: ${String(count)} undirected edge${plural(count)} in a directed graph ${agree(count, "has", "have")} another value on each half; the ${exporter.format} format writes the edge once, with the first half's value`,
349
- column: null,
350
- count,
351
- style: Object.freeze({ target: "edge", property })
352
- })
353
- ];
354
- }
355
- function styledSnapshot(snapshot, caps, tags, block, rules) {
356
- const attributes = caps?.block === "attributes";
357
- const stale = { node: staleTags(snapshot.nodes, rules, "node"), edge: staleTags(snapshot.edges, rules, "edge") };
358
- const roles = { node: roledNames(snapshot.nodes, caps, "node"), edge: roledNames(snapshot.edges, caps, "edge") };
359
- const staleBlock = snapshot.graph.has(STYLE_BLOCK_NAME);
360
- const changes = [stale.node, stale.edge, roles.node, roles.edge].some((names) => names.length > 0);
361
- if (!attributes && !staleBlock && !changes) {
362
- return snapshot;
363
- }
364
- const out = snapshot.withColumns();
365
- if (staleBlock) {
366
- out.graph.remove(STYLE_BLOCK_NAME);
367
- }
368
- for (const target of TARGETS) {
369
- const table = target === "node" ? out.nodes : out.edges;
370
- for (const name of stale[target]) {
371
- table.remove(name);
372
- }
373
- for (const name of roles[target]) {
374
- const col = table.get(name);
375
- if (col !== null) {
376
- table.set(name, col, { role: void 0 });
377
- }
378
- }
379
- }
380
- if (attributes) {
381
- setTagAttributes(out, tags);
382
- out.graph.set(STYLE_BLOCK_NAME, [block], { dtype: "string" });
383
- }
384
- return out;
385
- }
386
- function staleTags(table, rules, target) {
387
- const read = dataRead(rules, target);
388
- return table.names().filter((name) => isStyleTagName(name) && !read.has(name));
389
- }
390
- function roledNames(table, caps, target) {
391
- const writesLabel = (caps?.[target] ?? []).includes("label");
392
- return table.names().filter((name) => {
393
- const role = table.get(name)?.meta.role ?? "";
394
- return STYLE_ROLES.has(role) || role === "label" && writesLabel;
395
- });
396
- }
397
- function setTagAttributes(out, tags) {
398
- for (const target of TARGETS) {
399
- const table = target === "node" ? out.nodes : out.edges;
400
- const prefix = styleTag(target, "");
401
- for (const name of table.names().filter((c) => c.startsWith(prefix))) {
402
- table.remove(name);
403
- }
404
- for (const [name, col] of tags[target]) {
405
- const dtype = tagDtype(col);
406
- table.set(name, dtype === "string" ? col.map((v) => v === null ? null : String(v)) : col, { dtype });
407
- }
408
- }
409
- }
410
- function isStyleTagName(name) {
411
- return name.startsWith("graphty.style.") || name.startsWith("graphty_style_");
412
- }
413
- function dataRead(rules, target) {
414
- const out = /* @__PURE__ */ new Set();
415
- for (const { ext: _ext, ...rule } of rules.filter((r) => r.target === target)) {
416
- JSON.stringify(rule, (_k, v) => {
417
- const data = typeof v === "object" && v !== null && !Array.isArray(v) ? v.data : null;
418
- if (typeof data === "string" && Object.keys(v).length === 1) {
419
- out.add(data);
420
- }
421
- return v;
422
- });
423
- }
424
- return out;
425
- }
426
- function tagDtype(col) {
427
- let kind = null;
428
- for (const v of col) {
429
- if (v === null) {
430
- continue;
431
- }
432
- if (kind === null) {
433
- kind = typeof v;
434
- } else if (kind !== typeof v) {
435
- return "string";
436
- }
437
- }
438
- if (kind === "number") {
439
- return "f64";
440
- }
441
- return kind === "boolean" ? "bool" : "string";
442
- }
443
- export {
444
- dataRead as d,
445
- isKeptGraphtyProperty as i,
446
- prepareStyleExport as p,
447
- sharedInExportCall as s
448
- };
449
- //# sourceMappingURL=writer-DvHTl36J.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"writer-DvHTl36J.js","sources":["../../src/styles/io/writer.ts"],"sourcesContent":["/**\n * Writing a graph's styles: what `exportGraph(snapshot, format, { styles })` hands a format's exporter, the losses\n * reported before anything is written, and, for an exporter whose block goes into attributes, the snapshot with the\n * `graphty.styles` block and the tagged per-element values added as attributes.\n */\n\nimport type { GraphSnapshot } from \"@graphty/graph-format\";\n\nimport { agree, plural } from \"../../common/plural.js\";\nimport type { GraphExporter, LossNote } from \"../../types.js\";\nimport { STYLE_ISSUE } from \"../codes.js\";\nimport { toolDefaults } from \"../defaults.js\";\nimport { styleFingerprint } from \"../plan/features.js\";\nimport { canonicalFor, dataCell, degreeValues, plainCell, resolveStyles } from \"../plan/resolve.js\";\nimport type {\n ExtractedStyles,\n Mapping,\n StyleColumn,\n StyleProperty,\n StyleRule,\n StyleTarget,\n StyleValue,\n StyleWriteCapabilities,\n} from \"../types.js\";\nimport { STYLE_BLOCK_NAME, styleBlockLosses, styleTag, writeStyleBlock } from \"./block.js\";\n\n/**\n * What an exporter with a `styles` member receives as `options.styles` when styles are being written.\n * @category Styles\n */\nexport interface ExporterStyleInput {\n /**\n * Each element's value of one property, by element index (null where no rule gives one): what graphty draws, to\n * write into the format's own style slots.\n * @param target - nodes or edges\n * @param property - the property\n * @returns the values\n */\n picture(target: StyleTarget, property: StyleProperty): readonly (StyleValue | null)[];\n /** The `graphty.styles` block (JSON text) to place where the format keeps extra data. */\n readonly block: string;\n /** The per-element style values the block's rules read, by attribute name (`graphty.style.<target>.<key>`). */\n readonly tags: {\n /** Node values. */\n readonly node: ReadonlyMap<string, StyleColumn>;\n /** Edge values. */\n readonly edge: ReadonlyMap<string, StyleColumn>;\n };\n /** The styles themselves, for a format with a style language of its own. */\n readonly rules: ExtractedStyles;\n}\n\n/**\n * The options an exporter with a `styles` member reads its styles from: type its options as `Opts &\n * ExporterStyleOptions`.\n * @category Styles\n */\nexport interface ExporterStyleOptions {\n /** Present when styles are being written. */\n readonly styles?: ExporterStyleInput | undefined;\n}\n\n/** What an export with styles writes and loses, worked out before writing. */\ninterface PreparedStyleExport {\n /** The snapshot to hand the exporter: style roles removed, and the block and tagged values added as attributes. */\n readonly snapshot: GraphSnapshot;\n /** The exporter's `options.styles`, or null for an exporter without a `styles` member. */\n readonly input: ExporterStyleInput | null;\n /** W_STYLE_ notes: every property not written natively, and the rules when they are not kept. */\n readonly notes: readonly LossNote[];\n /** E_STYLES_MISMATCH when the styles belong to a different graph; nothing is then written. */\n readonly refusal: LossNote | null;\n}\n\n/** The roles of columns that hold styles; with styles given they are data, never written into a style slot. */\nconst STYLE_ROLES: ReadonlySet<string> = new Set([\"color\", \"size\", \"shape\", \"thickness\", \"hidden\"]);\nconst TARGETS: readonly StyleTarget[] = [\"node\", \"edge\"];\n\n/**\n * Works out an export with styles: the refusal when the styles belong to another graph, the losses, the exporter's\n * `options.styles`, and the snapshot to write.\n * @param snapshot - the graph being written\n * @param exporter - the format's exporter\n * @param given - the styles\n * @param plain - the export's other options, which decide what the format loses of the graph's data\n * @returns what to write and what is lost\n */\nexport function prepareStyleExport(\n snapshot: GraphSnapshot,\n exporter: GraphExporter,\n given: ExtractedStyles,\n plain?: Readonly<Record<string, unknown>>,\n): PreparedStyleExport {\n const fp = styleFingerprint(snapshot);\n const want = given.fingerprint;\n if (fp.nodes !== want.nodes || fp.edges !== want.edges || fp.ids !== want.ids) {\n return {\n snapshot,\n input: null,\n notes: [],\n refusal: Object.freeze({\n code: STYLE_ISSUE.MISMATCH,\n message: `the styles were read from or built for a different graph (${String(want.nodes)} nodes and ${String(want.edges)} edges, this graph has ${String(fp.nodes)} and ${String(fp.edges)}, or other node ids); nothing is written`,\n column: null,\n count: null,\n }),\n };\n }\n const caps = exporter.styles?.capabilities ?? null;\n let plan = writePlan(snapshot, exporter, given);\n if (keepsStyleBlock(exporter)) {\n // what the export loses of the graph's data, styles written as they are: the rules' inputs among it are carried\n let checked: readonly LossNote[];\n try {\n checked = exporter.check(plan.snapshot, plan.input === null ? plain : { ...plain, styles: plan.input });\n } catch {\n checked = [];\n }\n const carried = withLostInputsCarried(given, snapshot, checked);\n if (carried !== given) {\n plan = writePlan(snapshot, exporter, carried);\n }\n }\n return {\n snapshot: plan.snapshot,\n input: plan.input,\n notes: lossNotes(plan.extracted, exporter, caps, plan.picture, snapshot),\n refusal: null,\n };\n}\n\n/**\n * The work an exporter shares between the check and the write of one export call, by the styles input made for that\n * call (null until the first exporter step does it). Only an input writePlan() made is here, so an input a caller\n * builds and changes in place is always worked out again.\n */\nconst CALL_WORK = new WeakMap<\n ExporterStyleInput,\n { readonly key: readonly unknown[]; readonly value: unknown } | null\n>();\n\n/**\n * Work an exporter does from its styles input once per export call: the registry checks before it writes, with the\n * same input, graph and options. Outside an export call (an input the caller made) it is done every time.\n * @param input - the exporter's `options.styles`\n * @param key - what else the work reads (the graph, options), compared by identity\n * @param compute - the work\n * @returns its result\n */\nexport function sharedInExportCall<T>(input: ExporterStyleInput, key: readonly unknown[], compute: () => T): T {\n if (!CALL_WORK.has(input)) {\n return compute();\n }\n const done = CALL_WORK.get(input);\n if (done?.key.length === key.length && done.key.every((k, i) => k === key[i])) {\n return done.value as T;\n }\n const value = compute();\n CALL_WORK.set(input, { key, value });\n return value;\n}\n\n/**\n * What an exporter is handed to write a graph's styles: the snapshot with the block and tagged values added where\n * the format keeps them, and its `options.styles`.\n * @param snapshot - the graph\n * @param exporter - the exporter\n * @param extracted - the styles\n * @returns the plan\n */\nfunction writePlan(\n snapshot: GraphSnapshot,\n exporter: GraphExporter,\n extracted: ExtractedStyles,\n): {\n readonly snapshot: GraphSnapshot;\n readonly input: ExporterStyleInput | null;\n readonly extracted: ExtractedStyles;\n readonly picture: (target: StyleTarget, property: StyleProperty) => readonly (StyleValue | null)[];\n} {\n const caps = exporter.styles?.capabilities ?? null;\n const pictures = new Map<string, readonly (StyleValue | null)[]>();\n const picture = (target: StyleTarget, property: StyleProperty): readonly (StyleValue | null)[] => {\n const key = `${target}\\u0000${property}`;\n let values = pictures.get(key);\n if (values === undefined) {\n values = resolveStyles(extracted, target, property, snapshot);\n pictures.set(key, values);\n }\n return values;\n };\n const tags = { node: new Map<string, StyleColumn>(), edge: new Map<string, StyleColumn>() };\n for (const target of TARGETS) {\n for (const [key, col] of extracted.columns[target]) {\n tags[target].set(styleTag(target, key), col);\n }\n }\n const block = writeStyleBlock(extracted, { snapshot });\n const input = exporter.styles === undefined ? null : { picture, block, tags, rules: extracted };\n if (input !== null) {\n CALL_WORK.set(input, null);\n }\n return {\n snapshot: styledSnapshot(snapshot, caps, tags, block, extracted.styles.rules),\n input,\n extracted,\n picture,\n };\n}\n\n/**\n * Loss notes about a column whose values read back the same: written elsewhere (CSV's node table), under another\n * name a block finds by its values, with another role, storage or number type, or as a wider type.\n */\nconst VALUES_KEPT = /NODE_TABLE|NAME_CHANGED|ROLE_ASSUMED|STORAGE_CLASS|NUMBER_TYPE|INTEGRAL|WIDENED/;\n\n/**\n * The styles with every input the format will not read back as it is given carried as a style column of its own: a\n * data column the export drops or changes (its loss notes name it), and the in and out degrees when the file does not\n * keep the edges' direction. The rules then read the copies, which the file keeps beside the block, and give back the\n * same values.\n * @param extracted - the styles\n * @param snapshot - the graph\n * @param notes - what the export, styles written as they are, loses\n * @returns the styles, the same object when nothing is lost\n */\nfunction withLostInputsCarried(\n extracted: ExtractedStyles,\n snapshot: GraphSnapshot,\n notes: readonly LossNote[],\n): ExtractedStyles {\n const lost = new Set<string>();\n let direction = false;\n for (const note of notes) {\n if (!VALUES_KEPT.test(note.code)) {\n for (const name of note.columns ?? (note.column === null ? [] : [note.column])) {\n lost.add(name);\n }\n }\n direction ||= /DIRECTION/.test(note.code);\n }\n const carrier = new LostInputs(snapshot, lost, direction, extracted.columns);\n const rules = extracted.styles.rules.map((rule) => carrier.carry(rule));\n const changed = rules.some((rule, i) => rule !== extracted.styles.rules[i]);\n return changed ? { ...extracted, styles: { ...extracted.styles, rules }, columns: carrier.columns } : extracted;\n}\n\n/** Carries the inputs of rules that the format will not read back into style columns of their own. */\nclass LostInputs {\n /** The style columns, the copies added. */\n readonly columns: { readonly node: Map<string, StyleColumn>; readonly edge: Map<string, StyleColumn> };\n\n /** Whether the rule being carried read a lost input. */\n private touched = false;\n\n /**\n * A carrier for one export.\n * @param snapshot - the graph\n * @param lost - the data columns the export drops or changes\n * @param direction - whether the file loses the edges' direction (and so the in and out degrees)\n * @param columns - the styles' own style columns\n * @param columns.node - the node columns\n * @param columns.edge - the edge columns\n */\n constructor(\n private readonly snapshot: GraphSnapshot,\n private readonly lost: ReadonlySet<string>,\n private readonly direction: boolean,\n columns: { readonly node: ReadonlyMap<string, StyleColumn>; readonly edge: ReadonlyMap<string, StyleColumn> },\n ) {\n this.columns = { node: new Map(columns.node), edge: new Map(columns.edge) };\n }\n\n /**\n * A rule with every lost input it reads replaced by a copy of its values.\n * @param rule - the rule\n * @returns the rule read from copies, or the rule itself when it reads no lost input\n */\n carry(rule: StyleRule): StyleRule {\n this.touched = false;\n const { ext, ...given } = rule;\n const map = this.carryMap(rule);\n const where = this.walk(rule, given.where);\n if (!this.touched) {\n return rule;\n }\n const { map: _given, ...unmapped } = given;\n const plain = Object.keys(map).length === 0 ? { ...unmapped, where } : { ...unmapped, where, map };\n // a JSON copy drops undefined members, as the written block does; structuredClone would keep them\n const moved = JSON.parse(JSON.stringify(plain)) as StyleRule; // NOSONAR(S7784): undefined members must go\n return ext === undefined ? moved : { ...moved, ext };\n }\n\n /**\n * A rule's mappings with their lost inputs replaced. A passthrough reads a data column as the property's value: its\n * copy holds those values; one that gives no element a value (a list, text that is not a color) is left out, so\n * no other value the file reads back in the column (a list written as text) is given either.\n * @param rule - the rule\n * @returns the mappings\n */\n private carryMap(rule: StyleRule): Record<string, Mapping> {\n const map = Object.create(null) as Record<string, Mapping>;\n const { table } = this.tableOf(rule.target);\n for (const [property, mapping] of Object.entries(rule.map ?? {})) {\n if (mapping === undefined) {\n continue;\n }\n if (mapping.kind !== \"passthrough\") {\n map[property] = this.walk(rule, mapping);\n continue;\n }\n const name = (mapping.by as { data?: unknown }).data;\n const lostColumn = typeof name === \"string\" && this.lost.has(name) && table.has(name);\n const values = lostColumn ? this.cells(rule.target, name, canonicalFor(rule.target, property)) : null;\n if (values !== null && !values.some((v) => v !== null)) {\n this.touched = true;\n } else if (values !== null && this.isLost(rule.target, name)) {\n this.touched = true;\n map[property] = { ...mapping, by: this.copy(rule.target, `${property}.data.${name}`, () => values) };\n } else {\n map[property] = mapping;\n }\n }\n return map;\n }\n\n /**\n * A value with every other reference to a lost input reading a copy of its values as they are.\n * @param rule - the rule it belongs to\n * @param value - the value\n * @returns the value, references replaced\n */\n private walk<T>(rule: StyleRule, value: T): T {\n return JSON.parse(JSON.stringify(value, (_k, v: unknown) => this.replaced(rule, v))) as T;\n }\n\n /**\n * One reference with a lost input replaced by its copy: a data column, or a degree the file does not keep.\n * @param rule - the rule it belongs to\n * @param v - a value of the rule\n * @returns the value, or the reference to the copy\n */\n private replaced(rule: StyleRule, v: unknown): unknown {\n if (typeof v !== \"object\" || v === null || Array.isArray(v) || Object.keys(v).length !== 1) {\n return v;\n }\n const ref = v as { data?: unknown; computed?: unknown };\n if (this.isLost(rule.target, ref.data)) {\n const name = ref.data;\n this.touched = true;\n return this.copy(rule.target, `data.${name}`, () =>\n this.cells(rule.target, name, (raw) => (isStyleScalar(raw) ? raw : null)),\n );\n }\n const which = ref.computed;\n if ((which === \"indegree\" || which === \"outdegree\") && this.direction && rule.target === \"node\") {\n this.touched = true;\n return this.copy(rule.target, `computed.${which}`, () => degreeValues(this.snapshot, which));\n }\n return v;\n }\n\n /**\n * The reference to a copy of an input, made on first use and shared by every rule that reads it.\n * @param target - nodes or edges\n * @param base - what is copied\n * @param values - its values\n * @returns the reference\n */\n private copy(target: StyleTarget, base: string, values: () => StyleColumn): { style: string } {\n const key = `input.${base}`;\n const held = this.columns[target];\n if (!held.has(key)) {\n held.set(key, values());\n }\n return { style: key };\n }\n\n /**\n * Whether a name is a lost input that can be copied: only a column of plain values can, and a list, or a column with\n * no value, stays as it is.\n * @param target - nodes or edges\n * @param name - the name\n * @returns true for a lost input\n */\n private isLost(target: StyleTarget, name: unknown): name is string {\n const { table, n } = this.tableOf(target);\n return typeof name === \"string\" && this.lost.has(name) && table.has(name) && carriable(table, n, name);\n }\n\n /**\n * Every element's value of a data column.\n * @param target - nodes or edges\n * @param name - the column\n * @param read - the value of a cell\n * @returns the values\n */\n private cells(target: StyleTarget, name: string, read: (raw: unknown) => StyleValue | null): StyleColumn {\n const { table, n } = this.tableOf(target);\n return Array.from({ length: n }, (_u, i) => read(dataCell(table, name, i)));\n }\n\n /**\n * A target's table and row count.\n * @param target - nodes or edges\n * @returns the table and its row count\n */\n private tableOf(target: StyleTarget): { table: GraphSnapshot[\"nodes\"]; n: number } {\n const { snapshot } = this;\n return target === \"node\"\n ? { table: snapshot.nodes, n: snapshot.nodeCount }\n : { table: snapshot.edges, n: snapshot.edgeCount };\n }\n}\n\n/**\n * Whether a data column can be copied into a style column: some value, and every value text, a finite number or a\n * boolean.\n * @param table - the table\n * @param n - its row count\n * @param name - the column\n * @returns true when it can\n */\nfunction carriable(table: GraphSnapshot[\"nodes\"], n: number, name: string): boolean {\n let some = false;\n for (let i = 0; i < n; i++) {\n const cell = plainCell(table.value(name, i));\n if (cell !== null && cell !== undefined) {\n if (!isStyleScalar(cell)) {\n return false;\n }\n some = true;\n }\n }\n return some;\n}\n\n/**\n * Whether a cell is a value a style column holds: text, a finite number or a boolean.\n * @param v - the cell\n * @returns true for a scalar\n */\nfunction isStyleScalar(v: unknown): v is StyleValue {\n return typeof v === \"string\" || typeof v === \"boolean\" || (typeof v === \"number\" && Number.isFinite(v));\n}\n\n/**\n * Whether an exporter keeps the `graphty.styles` block, natively or as a graph attribute.\n * @param exporter - the exporter\n * @returns true when the block is written\n */\nfunction keepsStyleBlock(exporter: GraphExporter): boolean {\n const caps = exporter.styles?.capabilities;\n return (\n caps !== undefined &&\n (caps.block === \"native\" || (caps.block === \"attributes\" && exporter.capabilities.graphAttributes))\n );\n}\n\n/**\n * Whether a loss note is about a property only graphty draws (`graphty:<channel>`) in a file that keeps the block:\n * the block carries it, and no other program would draw it, so nothing is lost.\n * @param note - the note\n * @param exporter - the exporter writing the file\n * @returns true when the note names nothing lost\n */\nexport function isKeptGraphtyProperty(note: LossNote, exporter: GraphExporter): boolean {\n return note.style?.property.startsWith(\"graphty:\") === true && keepsStyleBlock(exporter);\n}\n\n/**\n * The losses of an export with styles: W_STYLE_NOT_WRITTEN for every property the format does not write natively\n * (all of them for an exporter without a `styles` member), and W_STYLE_RULES_NOT_KEPT when the block is not kept.\n * @param extracted - the styles\n * @param exporter - the exporter\n * @param caps - its style capabilities, or null\n * @param picture - each element's value of a property\n * @param snapshot - the graph\n * @returns the notes\n */\nfunction lossNotes(\n extracted: ExtractedStyles,\n exporter: GraphExporter,\n caps: StyleWriteCapabilities | null,\n picture: (target: StyleTarget, property: StyleProperty) => readonly (StyleValue | null)[],\n snapshot: GraphSnapshot,\n): LossNote[] {\n const notes: LossNote[] = [];\n const kept = keepsStyleBlock(exporter);\n for (const target of TARGETS) {\n const written = new Set<string>(caps?.[target] ?? []);\n for (const property of ruleProperties(extracted.styles.rules, target)) {\n // a property only graphty draws is written into the block alone: lost only when the block is\n if (written.has(property) || (kept && property.startsWith(\"graphty:\"))) {\n if (target === \"edge\") {\n notes.push(...pairNotes(snapshot, exporter, property, picture(\"edge\", property as StyleProperty)));\n }\n } else {\n notes.push(notWrittenNote(target, property, exporter, picture));\n }\n }\n }\n notes.push(...graphLossNotes(extracted, exporter, caps));\n if (kept) {\n notes.push(...styleBlockLosses(writeStyleBlock(extracted, { snapshot }), extracted.styles.rules.length));\n } else if (extracted.styles.rules.length > 0) {\n notes.push(\n Object.freeze({\n code: STYLE_ISSUE.RULES_NOT_KEPT,\n message: `the style rules are not kept: the ${exporter.format} format has no place for them; importing the file infers them again from what it holds`,\n column: null,\n count: extracted.styles.rules.length,\n }),\n );\n }\n return notes;\n}\n\n/**\n * W_STYLE_NOT_WRITTEN for every graph property the format does not write, except one whose value is what the program\n * the format is written for draws anyway (a white background for yEd): nothing is lost there.\n * @param extracted - the styles\n * @param exporter - the exporter\n * @param caps - its style capabilities, or null\n * @returns the notes\n */\nfunction graphLossNotes(\n extracted: ExtractedStyles,\n exporter: GraphExporter,\n caps: StyleWriteCapabilities | null,\n): LossNote[] {\n const graphWritten = new Set<string>(caps?.graph ?? []);\n const drawn: Readonly<Record<string, { readonly value: unknown } | undefined>> =\n (caps?.tool === undefined ? null : toolDefaults(caps.tool))?.graph ?? {};\n return Object.entries(extracted.styles.graph)\n .filter(([property, value]) => !graphWritten.has(property) && drawn[property]?.value !== value)\n .map(([property]) => property)\n .map((property) =>\n Object.freeze({\n code: STYLE_ISSUE.NOT_WRITTEN,\n message: `the graph's ${property} is not written: the ${exporter.format} format has no place for it`,\n column: null,\n count: 1,\n style: Object.freeze({ target: \"graph\" as const, property: property as \"background\" }),\n }),\n );\n}\n\n/**\n * The properties the rules of a target write, in first-written order.\n * @param rules - the rules\n * @param target - nodes or edges\n * @returns the properties\n */\nfunction ruleProperties(rules: readonly StyleRule[], target: StyleTarget): Set<string> {\n return new Set(\n rules\n .filter((rule) => rule.target === target)\n .flatMap((rule) => [...Object.keys(rule.set ?? {}), ...Object.keys(rule.map ?? {})]),\n );\n}\n\n/**\n * W_STYLE_NOT_WRITTEN for a property the format has no place for.\n * @param target - nodes or edges\n * @param property - the property\n * @param exporter - the exporter\n * @param picture - each element's value of a property\n * @returns the note\n */\nfunction notWrittenNote(\n target: StyleTarget,\n property: string,\n exporter: GraphExporter,\n picture: (target: StyleTarget, property: StyleProperty) => readonly (StyleValue | null)[],\n): LossNote {\n const count = picture(target, property as StyleProperty).filter((v) => v !== null).length;\n return Object.freeze({\n code: STYLE_ISSUE.NOT_WRITTEN,\n message: `${target} ${property} is not written: the ${exporter.format} format has no place for it (${String(count)} ${target}${plural(count)} ${agree(count, \"has\", \"have\")} a value)`,\n column: null,\n count,\n style: Object.freeze({ target, property: property as StyleProperty }),\n });\n}\n\n/**\n * W_STYLE_APPROXIMATED for the second halves of undirected edges in a directed graph whose value of a property\n * differs from the first half's: every format writes such an edge once, so both halves read back with one value.\n * @param snapshot - the graph\n * @param exporter - the exporter\n * @param property - the edge property\n * @param values - each edge's value\n * @returns the note, or none\n */\nfunction pairNotes(\n snapshot: GraphSnapshot,\n exporter: GraphExporter,\n property: string,\n values: readonly (StyleValue | null)[],\n): LossNote[] {\n const pair = snapshot.edges.byRole(\"pair\");\n let count = 0;\n for (let i = 0; pair !== null && i < values.length; i++) {\n const other = pair.isSet(i) ? (pair.value(i) as number) : i;\n if (other < i && values[i] !== values[other]) {\n count++;\n }\n }\n if (count === 0) {\n return [];\n }\n return [\n Object.freeze({\n code: STYLE_ISSUE.APPROXIMATED,\n message: `edge ${property}: ${String(count)} undirected edge${plural(count)} in a directed graph ${agree(count, \"has\", \"have\")} another value on each half; the ${exporter.format} format writes the edge once, with the first half's value`,\n column: null,\n count,\n style: Object.freeze({ target: \"edge\" as const, property: property as StyleProperty }),\n }),\n ];\n}\n\n/**\n * The snapshot an exporter writes when styles are given: columns with a style role keep their data but lose the\n * role (the style writer is the only thing that writes the format's style slots), and for `block: \"attributes\"`\n * the block becomes a graph attribute and the tagged values element attributes.\n * @param snapshot - the graph\n * @param caps - the exporter's style capabilities, or null\n * @param tags - the tagged per-element values\n * @param tags.node - node values by attribute name\n * @param tags.edge - edge values by attribute name\n * @param block - the block's text\n * @param rules - the rules written, which keep a style value column of an earlier write they read as data\n * @returns the snapshot to write (the same object when nothing changes)\n */\nfunction styledSnapshot(\n snapshot: GraphSnapshot,\n caps: StyleWriteCapabilities | null,\n tags: { readonly node: ReadonlyMap<string, StyleColumn>; readonly edge: ReadonlyMap<string, StyleColumn> },\n block: string,\n rules: readonly StyleRule[],\n): GraphSnapshot {\n const attributes = caps?.block === \"attributes\";\n // the per-element style values of an earlier write whose block was set aside are data now; these styles write\n // their own under the same names, so the old ones go, unless these styles read them as data\n const stale = { node: staleTags(snapshot.nodes, rules, \"node\"), edge: staleTags(snapshot.edges, rules, \"edge\") };\n // a format that writes the label from the styles has its label slot taken: the label column is data there too\n const roles = { node: roledNames(snapshot.nodes, caps, \"node\"), edge: roledNames(snapshot.edges, caps, \"edge\") };\n // the block of an earlier import is replaced by the one these styles write, wherever the format puts that\n const staleBlock = snapshot.graph.has(STYLE_BLOCK_NAME);\n const changes = [stale.node, stale.edge, roles.node, roles.edge].some((names) => names.length > 0);\n if (!attributes && !staleBlock && !changes) {\n return snapshot;\n }\n const out = snapshot.withColumns();\n if (staleBlock) {\n out.graph.remove(STYLE_BLOCK_NAME);\n }\n for (const target of TARGETS) {\n const table = target === \"node\" ? out.nodes : out.edges;\n for (const name of stale[target]) {\n table.remove(name);\n }\n for (const name of roles[target]) {\n const col = table.get(name);\n if (col !== null) {\n // an explicit undefined role in the patch replaces the column's role with none\n table.set(name, col, { role: undefined });\n }\n }\n }\n if (attributes) {\n setTagAttributes(out, tags);\n out.graph.set(STYLE_BLOCK_NAME, [block], { dtype: \"string\" });\n }\n return out;\n}\n\n/**\n * The per-element style values of an earlier write that these rules do not read as data.\n * @param table - the node or edge table\n * @param rules - the rules written\n * @param target - nodes or edges\n * @returns the column names\n */\nfunction staleTags(table: GraphSnapshot[\"nodes\"], rules: readonly StyleRule[], target: StyleTarget): string[] {\n const read = dataRead(rules, target);\n return table.names().filter((name) => isStyleTagName(name) && !read.has(name));\n}\n\n/**\n * The columns whose style role the styles take: every style role, and the label where the format writes the label\n * from the styles.\n * @param table - the node or edge table\n * @param caps - the exporter's style capabilities, or null\n * @param target - nodes or edges\n * @returns the column names\n */\nfunction roledNames(table: GraphSnapshot[\"nodes\"], caps: StyleWriteCapabilities | null, target: StyleTarget): string[] {\n const writesLabel = (caps?.[target] ?? []).includes(\"label\");\n return table.names().filter((name) => {\n const role = table.get(name)?.meta.role ?? \"\";\n return STYLE_ROLES.has(role) || (role === \"label\" && writesLabel);\n });\n}\n\n/**\n * Sets the tagged per-element values as element attributes, replacing those of an earlier import in the order of\n * these styles' columns, so writing a file read back gives the same bytes whichever elements held a value first.\n * @param out - the graph, changed in place\n * @param tags - the tagged values\n * @param tags.node - node values by attribute name\n * @param tags.edge - edge values by attribute name\n */\nfunction setTagAttributes(\n out: GraphSnapshot,\n tags: { readonly node: ReadonlyMap<string, StyleColumn>; readonly edge: ReadonlyMap<string, StyleColumn> },\n): void {\n for (const target of TARGETS) {\n const table = target === \"node\" ? out.nodes : out.edges;\n const prefix = styleTag(target, \"\");\n for (const name of table.names().filter((c) => c.startsWith(prefix))) {\n table.remove(name);\n }\n for (const [name, col] of tags[target]) {\n const dtype = tagDtype(col);\n table.set(name, dtype === \"string\" ? col.map((v) => (v === null ? null : String(v))) : col, { dtype });\n }\n }\n}\n\n/**\n * Whether a column name is one graphty writes per-element style values under: `graphty.style.<target>.<key>`, or\n * `graphty_style_<...>` where the format allows no dots in a name (GML, Cytoscape.js).\n * @param name - the column name\n * @returns true for a style value name\n */\nfunction isStyleTagName(name: string): boolean {\n return name.startsWith(\"graphty.style.\") || name.startsWith(\"graphty_style_\");\n}\n\n/**\n * The data columns the rules of one target read.\n * @param rules - the rules\n * @param target - nodes or edges\n * @returns the column names\n */\nexport function dataRead(rules: readonly StyleRule[], target: StyleTarget): Set<string> {\n const out = new Set<string>();\n for (const { ext: _ext, ...rule } of rules.filter((r) => r.target === target)) {\n JSON.stringify(rule, (_k, v: unknown) => {\n const data =\n typeof v === \"object\" && v !== null && !Array.isArray(v) ? (v as { data?: unknown }).data : null;\n if (typeof data === \"string\" && Object.keys(v as object).length === 1) {\n out.add(data);\n }\n return v;\n });\n }\n return out;\n}\n\n/**\n * The dtype a tagged column is written with: numbers, booleans or text (a mixed column as text).\n * @param col - the values\n * @returns the dtype\n */\nfunction tagDtype(col: StyleColumn): \"f64\" | \"bool\" | \"string\" {\n let kind: string | null = null;\n for (const v of col) {\n if (v === null) {\n continue;\n }\n if (kind === null) {\n kind = typeof v;\n } else if (kind !== typeof v) {\n return \"string\";\n }\n }\n if (kind === \"number\") {\n return \"f64\";\n }\n return kind === \"boolean\" ? \"bool\" : \"string\";\n}\n"],"names":[],"mappings":";;AA2EA,MAAM,kCAAuC,IAAI,CAAC,SAAS,QAAQ,SAAS,aAAa,QAAQ,CAAC;AAClG,MAAM,UAAkC,CAAC,QAAQ,MAAM;AAWhD,SAAS,mBACZ,UACA,UACA,OACA,OACmB;AACnB,QAAM,KAAK,iBAAiB,QAAQ;AACpC,QAAM,OAAO,MAAM;AACnB,MAAI,GAAG,UAAU,KAAK,SAAS,GAAG,UAAU,KAAK,SAAS,GAAG,QAAQ,KAAK,KAAK;AAC3E,WAAO;AAAA,MACH;AAAA,MACA,OAAO;AAAA,MACP,OAAO,CAAA;AAAA,MACP,SAAS,OAAO,OAAO;AAAA,QACnB,MAAM,YAAY;AAAA,QAClB,SAAS,6DAA6D,OAAO,KAAK,KAAK,CAAC,cAAc,OAAO,KAAK,KAAK,CAAC,0BAA0B,OAAO,GAAG,KAAK,CAAC,QAAQ,OAAO,GAAG,KAAK,CAAC;AAAA,QAC1L,QAAQ;AAAA,QACR,OAAO;AAAA,MAAA,CACV;AAAA,IAAA;AAAA,EAET;AACA,QAAM,OAAO,SAAS,QAAQ,gBAAgB;AAC9C,MAAI,OAAO,UAAU,UAAU,UAAU,KAAK;AAC9C,MAAI,gBAAgB,QAAQ,GAAG;AAE3B,QAAI;AACJ,QAAI;AACA,gBAAU,SAAS,MAAM,KAAK,UAAU,KAAK,UAAU,OAAO,QAAQ,EAAE,GAAG,OAAO,QAAQ,KAAK,OAAO;AAAA,IAC1G,QAAQ;AACJ,gBAAU,CAAA;AAAA,IACd;AACA,UAAM,UAAU,sBAAsB,OAAO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