@graphty/graph-io 0.3.40 → 0.3.41

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 (189) hide show
  1. package/dist/chunks/{choose-CS3fvGT1.js → choose-CwFQamH9.js} +2 -2
  2. package/dist/chunks/{choose-CS3fvGT1.js.map → choose-CwFQamH9.js.map} +1 -1
  3. package/dist/chunks/{constants-DqKZT6cH.js → constants-Cf4Nn6tw.js} +2 -2
  4. package/dist/chunks/{constants-DqKZT6cH.js.map → constants-Cf4Nn6tw.js.map} +1 -1
  5. package/dist/chunks/{escape-BJRLd3vJ.js → escape-DBb8zuNE.js} +2 -2
  6. package/dist/chunks/{escape-BJRLd3vJ.js.map → escape-DBb8zuNE.js.map} +1 -1
  7. package/dist/chunks/{export-B-aVCwyG.js → export-DD3Lvw-F.js} +173 -116
  8. package/dist/chunks/export-DD3Lvw-F.js.map +1 -0
  9. package/dist/chunks/{exporter-Bcp-l4Bo.js → exporter-BqtmlxNr.js} +545 -459
  10. package/dist/chunks/exporter-BqtmlxNr.js.map +1 -0
  11. package/dist/chunks/{exporter-6ocL_9x_.js → exporter-CS35R6Fg.js} +4 -4
  12. package/dist/chunks/{exporter-6ocL_9x_.js.map → exporter-CS35R6Fg.js.map} +1 -1
  13. package/dist/chunks/{exporter-BVXnV9-9.js → exporter-D8r1N2dU.js} +28 -16
  14. package/dist/chunks/exporter-D8r1N2dU.js.map +1 -0
  15. package/dist/chunks/{exporter-SFYkDzD0.js → exporter-NMplSnYn.js} +23 -20
  16. package/dist/chunks/{exporter-SFYkDzD0.js.map → exporter-NMplSnYn.js.map} +1 -1
  17. package/dist/chunks/{importer-CPqnIY8m.js → importer-BKC7AmCA.js} +42 -29
  18. package/dist/chunks/importer-BKC7AmCA.js.map +1 -0
  19. package/dist/chunks/{importer-D_srHyj6.js → importer-BdWHmlmG.js} +4 -4
  20. package/dist/chunks/{importer-D_srHyj6.js.map → importer-BdWHmlmG.js.map} +1 -1
  21. package/dist/chunks/{importer-AjwOJrn2.js → importer-BfbzWk6k.js} +202 -181
  22. package/dist/chunks/importer-BfbzWk6k.js.map +1 -0
  23. package/dist/chunks/{importer-BpuS3J8C.js → importer-BmaZcskq.js} +73 -60
  24. package/dist/chunks/importer-BmaZcskq.js.map +1 -0
  25. package/dist/chunks/{importer-DEp_fYjf.js → importer-DviEsHy4.js} +92 -64
  26. package/dist/chunks/importer-DviEsHy4.js.map +1 -0
  27. package/dist/chunks/{importer-DcKB97kW.js → importer-S-abxJHn.js} +5 -5
  28. package/dist/chunks/{importer-DcKB97kW.js.map → importer-S-abxJHn.js.map} +1 -1
  29. package/dist/chunks/{importer-BJlGAOht.js → importer-r29cWnEf.js} +3 -3
  30. package/dist/chunks/{importer-BJlGAOht.js.map → importer-r29cWnEf.js.map} +1 -1
  31. package/dist/chunks/{json-elements-DpO6AXIc.js → json-elements-DdF-etPT.js} +3 -3
  32. package/dist/chunks/{json-elements-DpO6AXIc.js.map → json-elements-DdF-etPT.js.map} +1 -1
  33. package/dist/chunks/{ontology-export-50L9DOV4.js → ontology-export-BC0zyPhj.js} +2 -2
  34. package/dist/chunks/{ontology-export-50L9DOV4.js.map → ontology-export-BC0zyPhj.js.map} +1 -1
  35. package/dist/chunks/{records-r3SFHz11.js → records-Uc3LkABx.js} +15 -12
  36. package/dist/chunks/records-Uc3LkABx.js.map +1 -0
  37. package/dist/chunks/{text-Bjfa1xYL.js → text-Bh9SaAob.js} +20 -11
  38. package/dist/chunks/text-Bh9SaAob.js.map +1 -0
  39. package/dist/csv.js +67 -49
  40. package/dist/csv.js.map +1 -1
  41. package/dist/cx.js +1 -1
  42. package/dist/cx2.js +2 -2
  43. package/dist/cys.js +1 -1
  44. package/dist/dot.js +1 -1
  45. package/dist/gexf.js +195 -97
  46. package/dist/gexf.js.map +1 -1
  47. package/dist/gml.js +170 -149
  48. package/dist/gml.js.map +1 -1
  49. package/dist/graph-io.js +26 -26
  50. package/dist/graphml.js +2 -2
  51. package/dist/json.js +1 -1
  52. package/dist/neo4j.js +103 -65
  53. package/dist/neo4j.js.map +1 -1
  54. package/dist/obo.js +1 -1
  55. package/dist/pajek.js +1 -1
  56. package/dist/src/common/attributes.d.ts.map +1 -1
  57. package/dist/src/common/attributes.js +34 -9
  58. package/dist/src/common/attributes.js.map +1 -1
  59. package/dist/src/common/input.d.ts.map +1 -1
  60. package/dist/src/common/input.js +180 -102
  61. package/dist/src/common/input.js.map +1 -1
  62. package/dist/src/common/text.d.ts +7 -0
  63. package/dist/src/common/text.d.ts.map +1 -1
  64. package/dist/src/common/text.js +15 -7
  65. package/dist/src/common/text.js.map +1 -1
  66. package/dist/src/common/zip.d.ts.map +1 -1
  67. package/dist/src/common/zip.js +36 -19
  68. package/dist/src/common/zip.js.map +1 -1
  69. package/dist/src/formats/csv/exporter.d.ts.map +1 -1
  70. package/dist/src/formats/csv/exporter.js +77 -25
  71. package/dist/src/formats/csv/exporter.js.map +1 -1
  72. package/dist/src/formats/csv/importer.d.ts.map +1 -1
  73. package/dist/src/formats/csv/importer.js +16 -6
  74. package/dist/src/formats/csv/importer.js.map +1 -1
  75. package/dist/src/formats/csv/records.d.ts.map +1 -1
  76. package/dist/src/formats/csv/records.js +18 -10
  77. package/dist/src/formats/csv/records.js.map +1 -1
  78. package/dist/src/formats/cys/tables.d.ts.map +1 -1
  79. package/dist/src/formats/cys/tables.js +11 -8
  80. package/dist/src/formats/cys/tables.js.map +1 -1
  81. package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
  82. package/dist/src/formats/gexf/exporter.js +65 -37
  83. package/dist/src/formats/gexf/exporter.js.map +1 -1
  84. package/dist/src/formats/gexf/importer.d.ts.map +1 -1
  85. package/dist/src/formats/gexf/importer.js +138 -50
  86. package/dist/src/formats/gexf/importer.js.map +1 -1
  87. package/dist/src/formats/gml/exporter.d.ts.map +1 -1
  88. package/dist/src/formats/gml/exporter.js +51 -35
  89. package/dist/src/formats/gml/exporter.js.map +1 -1
  90. package/dist/src/formats/gml/importer.d.ts.map +1 -1
  91. package/dist/src/formats/gml/importer.js +103 -58
  92. package/dist/src/formats/gml/importer.js.map +1 -1
  93. package/dist/src/formats/gml/syntax.d.ts.map +1 -1
  94. package/dist/src/formats/gml/syntax.js +17 -8
  95. package/dist/src/formats/gml/syntax.js.map +1 -1
  96. package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
  97. package/dist/src/formats/graphml/exporter.js +34 -24
  98. package/dist/src/formats/graphml/exporter.js.map +1 -1
  99. package/dist/src/formats/graphml/importer.d.ts.map +1 -1
  100. package/dist/src/formats/graphml/importer.js +17 -13
  101. package/dist/src/formats/graphml/importer.js.map +1 -1
  102. package/dist/src/formats/graphml/tree.js +23 -14
  103. package/dist/src/formats/graphml/tree.js.map +1 -1
  104. package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
  105. package/dist/src/formats/graphml/yfiles.js +22 -10
  106. package/dist/src/formats/graphml/yfiles.js.map +1 -1
  107. package/dist/src/formats/json/exporter.d.ts.map +1 -1
  108. package/dist/src/formats/json/exporter.js +38 -21
  109. package/dist/src/formats/json/exporter.js.map +1 -1
  110. package/dist/src/formats/json/importer.d.ts.map +1 -1
  111. package/dist/src/formats/json/importer.js +536 -343
  112. package/dist/src/formats/json/importer.js.map +1 -1
  113. package/dist/src/formats/json/obographs.js +29 -17
  114. package/dist/src/formats/json/obographs.js.map +1 -1
  115. package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
  116. package/dist/src/formats/neo4j/exporter.js +73 -43
  117. package/dist/src/formats/neo4j/exporter.js.map +1 -1
  118. package/dist/src/formats/neo4j/header.d.ts.map +1 -1
  119. package/dist/src/formats/neo4j/header.js +37 -16
  120. package/dist/src/formats/neo4j/header.js.map +1 -1
  121. package/dist/src/formats/neo4j/importer.d.ts.map +1 -1
  122. package/dist/src/formats/neo4j/importer.js +21 -11
  123. package/dist/src/formats/neo4j/importer.js.map +1 -1
  124. package/dist/src/formats/obo/exporter.d.ts.map +1 -1
  125. package/dist/src/formats/obo/exporter.js +18 -7
  126. package/dist/src/formats/obo/exporter.js.map +1 -1
  127. package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
  128. package/dist/src/formats/pajek/exporter.js +142 -73
  129. package/dist/src/formats/pajek/exporter.js.map +1 -1
  130. package/dist/src/formats/pajek/importer.d.ts.map +1 -1
  131. package/dist/src/formats/pajek/importer.js +26 -15
  132. package/dist/src/formats/pajek/importer.js.map +1 -1
  133. package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
  134. package/dist/src/formats/pajek/syntax.js +85 -58
  135. package/dist/src/formats/pajek/syntax.js.map +1 -1
  136. package/dist/src/formats/xgmml/emit.d.ts +7 -0
  137. package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
  138. package/dist/src/formats/xgmml/emit.js +79 -40
  139. package/dist/src/formats/xgmml/emit.js.map +1 -1
  140. package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
  141. package/dist/src/formats/xgmml/exporter.js +38 -12
  142. package/dist/src/formats/xgmml/exporter.js.map +1 -1
  143. package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
  144. package/dist/src/formats/xgmml/importer.js +38 -18
  145. package/dist/src/formats/xgmml/importer.js.map +1 -1
  146. package/dist/src/sniff.js +109 -57
  147. package/dist/src/sniff.js.map +1 -1
  148. package/dist/xgmml.js +2 -2
  149. package/package.json +2 -2
  150. package/src/common/attributes.ts +59 -19
  151. package/src/common/input.ts +216 -102
  152. package/src/common/text.ts +24 -15
  153. package/src/common/zip.ts +47 -18
  154. package/src/formats/csv/exporter.ts +103 -39
  155. package/src/formats/csv/importer.ts +17 -6
  156. package/src/formats/csv/records.ts +19 -10
  157. package/src/formats/cys/tables.ts +11 -10
  158. package/src/formats/gexf/exporter.ts +67 -36
  159. package/src/formats/gexf/importer.ts +173 -63
  160. package/src/formats/gml/exporter.ts +78 -82
  161. package/src/formats/gml/importer.ts +119 -68
  162. package/src/formats/gml/syntax.ts +18 -8
  163. package/src/formats/graphml/exporter.ts +44 -24
  164. package/src/formats/graphml/importer.ts +18 -11
  165. package/src/formats/graphml/tree.ts +22 -12
  166. package/src/formats/graphml/yfiles.ts +23 -10
  167. package/src/formats/json/exporter.ts +40 -21
  168. package/src/formats/json/importer.ts +701 -385
  169. package/src/formats/json/obographs.ts +35 -15
  170. package/src/formats/neo4j/exporter.ts +79 -41
  171. package/src/formats/neo4j/header.ts +50 -16
  172. package/src/formats/neo4j/importer.ts +21 -10
  173. package/src/formats/obo/exporter.ts +34 -17
  174. package/src/formats/pajek/exporter.ts +180 -117
  175. package/src/formats/pajek/importer.ts +27 -15
  176. package/src/formats/pajek/syntax.ts +99 -58
  177. package/src/formats/xgmml/emit.ts +88 -40
  178. package/src/formats/xgmml/exporter.ts +40 -12
  179. package/src/formats/xgmml/importer.ts +45 -23
  180. package/src/sniff.ts +115 -59
  181. package/dist/chunks/export-B-aVCwyG.js.map +0 -1
  182. package/dist/chunks/exporter-BVXnV9-9.js.map +0 -1
  183. package/dist/chunks/exporter-Bcp-l4Bo.js.map +0 -1
  184. package/dist/chunks/importer-AjwOJrn2.js.map +0 -1
  185. package/dist/chunks/importer-BpuS3J8C.js.map +0 -1
  186. package/dist/chunks/importer-CPqnIY8m.js.map +0 -1
  187. package/dist/chunks/importer-DEp_fYjf.js.map +0 -1
  188. package/dist/chunks/records-r3SFHz11.js.map +0 -1
  189. package/dist/chunks/text-Bjfa1xYL.js.map +0 -1
@@ -1,9 +1,9 @@
1
1
  import { GraphFormatError, INVALID_INDEX, MAX_COUNT } from "@graphty/graph-format";
2
2
  import { c as childrenCsr } from "./children-CL3Cy0ez.js";
3
- import { r as resolveExportOptions, c as capabilities, a as checkCapabilities, L as LOSS, p as pairFolding, b as plural, $ as agree, aE as sanitizeIds, e as explicitWeights, bz as isNmtoken, bx as isCanonicalIntegerText, bA as mangleNmtoken, aG as formatInteger, ab as formatF64, aa as formatF32, al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, a4 as textChunks, am as throwIfAborted, ar as IdCoercer, aq as DirectionResolver, aJ as isWeightField, bH as declareAttribute, a0 as uniqueColumnName, a1 as declareResolved, bW as takenIn, aK as parseWeightText, bK as parseDeclaredValue, bL as losesPrecision, P as PRECISION_CODE, bI as overflowsToInfinity } from "./export-B-aVCwyG.js";
4
- import { a as escapeXmlText, j as isWhitespace, n as isXmlName, e as escapeXmlAttribute, l as localName, x as xmlIllegalTextNotes, t as tokenizeXml, f as xmlDeclaredEncoding, g as XmlEmptyInputError, X as XmlSyntaxError, s as sniffXmlText } from "./escape-BJRLd3vJ.js";
3
+ import { r as resolveExportOptions, c as capabilities, a as checkCapabilities, L as LOSS, p as pairFolding, b as plural, $ as agree, aE as sanitizeIds, e as explicitWeights, bz as isNmtoken, bx as isCanonicalIntegerText, bA as mangleNmtoken, aG as formatInteger, ab as formatF64, aa as formatF32, al as resolveImportOptions, a8 as ImportReportBuilder, ao as reportSinkOptions, an as reportUnusedOptions, a4 as textChunks, am as throwIfAborted, ar as IdCoercer, aq as DirectionResolver, aJ as isWeightField, bH as declareAttribute, a0 as uniqueColumnName, a1 as declareResolved, bW as takenIn, aK as parseWeightText, bK as parseDeclaredValue, bL as losesPrecision, P as PRECISION_CODE, bI as overflowsToInfinity } from "./export-DD3Lvw-F.js";
4
+ import { j as isWhitespace, n as isXmlName, a as escapeXmlText, e as escapeXmlAttribute, l as localName, x as xmlIllegalTextNotes, t as tokenizeXml, f as xmlDeclaredEncoding, g as XmlEmptyInputError, X as XmlSyntaxError, s as sniffXmlText } from "./escape-DBb8zuNE.js";
5
5
  import { j as joinText, e as encodeChunks } from "./writer-DxjgHwSe.js";
6
- import { F as FORMAT, a as GRAPHML_LOSS, Y as YFILES_NAMESPACE, X as XSI_NAMESPACE, S as SCHEMA_LOCATION, b as GRAPHML_NAMESPACE, O as ORIGINAL_ID_ATTRIBUTE, M as META_KEY, L as LABEL_COLUMN, R as RESERVED_NODE_NAMES, c as RESERVED_EDGE_NAMES, P as PARENT_COLUMN, T as TARGET_PORT_COLUMN, d as SOURCE_PORT_COLUMN, E as EDGE_ID_COLUMN, e as MIME_TYPES, f as EXTENSIONS, G as GRAPHML_ISSUE, g as ORIGINAL_ID_COLUMN, H as HYPEREDGE_HUB_COLUMN } from "./constants-DqKZT6cH.js";
6
+ import { F as FORMAT, a as GRAPHML_LOSS, Y as YFILES_NAMESPACE, X as XSI_NAMESPACE, S as SCHEMA_LOCATION, b as GRAPHML_NAMESPACE, O as ORIGINAL_ID_ATTRIBUTE, M as META_KEY, L as LABEL_COLUMN, R as RESERVED_NODE_NAMES, c as RESERVED_EDGE_NAMES, P as PARENT_COLUMN, T as TARGET_PORT_COLUMN, d as SOURCE_PORT_COLUMN, E as EDGE_ID_COLUMN, e as MIME_TYPES, f as EXTENSIONS, G as GRAPHML_ISSUE, g as ORIGINAL_ID_COLUMN, H as HYPEREDGE_HUB_COLUMN } from "./constants-Cf4Nn6tw.js";
7
7
  const ATTRIBUTE_PREFIX = "@_";
8
8
  const TEXT_KEY = "#text";
9
9
  class XmlTreeBuilder {
@@ -178,18 +178,7 @@ ${indent}<${name}>${escapeXmlText(text22)}</${name}>`);
178
178
  return;
179
179
  }
180
180
  const object = value;
181
- let attrs = "";
182
- let text2 = null;
183
- let hasChildren = false;
184
- for (const [key, child2] of Object.entries(object)) {
185
- if (key === TEXT_KEY) {
186
- text2 = scalarText(child2);
187
- } else if (key.startsWith(ATTRIBUTE_PREFIX)) {
188
- attrs += ` ${key.slice(ATTRIBUTE_PREFIX.length)}="${escapeXmlAttribute(scalarText(child2))}"`;
189
- } else {
190
- hasChildren = true;
191
- }
192
- }
181
+ const { attrs, text: text2, hasChildren } = scanElement(object);
193
182
  if (!hasChildren) {
194
183
  out.push(
195
184
  text2 === null || text2.length === 0 ? `
@@ -212,6 +201,21 @@ ${indent}<${name}${attrs}>`);
212
201
  out.push(`
213
202
  ${indent}</${name}>`);
214
203
  }
204
+ function scanElement(object) {
205
+ let attrs = "";
206
+ let text2 = null;
207
+ let hasChildren = false;
208
+ for (const [key, child2] of Object.entries(object)) {
209
+ if (key === TEXT_KEY) {
210
+ text2 = scalarText(child2);
211
+ } else if (key.startsWith(ATTRIBUTE_PREFIX)) {
212
+ attrs += ` ${key.slice(ATTRIBUTE_PREFIX.length)}="${escapeXmlAttribute(scalarText(child2))}"`;
213
+ } else {
214
+ hasChildren = true;
215
+ }
216
+ }
217
+ return { attrs, text: text2, hasChildren };
218
+ }
215
219
  function scalarText(value) {
216
220
  switch (typeof value) {
217
221
  case "string":
@@ -270,16 +274,7 @@ function staleGraphicsRows(column, table, domain) {
270
274
  }
271
275
  let stale = 0;
272
276
  for (let r = 0; r < column.length; r++) {
273
- const wants = /* @__PURE__ */ new Set();
274
- for (const tree of trees) {
275
- const want = graphicsValues(domain, tree.values[r]).find(([f]) => f === field);
276
- if (want !== void 0) {
277
- wants.add(JSON.stringify(want[1]));
278
- }
279
- }
280
- if (wants.size === 0) {
281
- wants.add(JSON.stringify(void 0));
282
- }
277
+ const wants = wantedGraphics(trees, domain, field, r);
283
278
  const value = column.value(r);
284
279
  const have = column.meta.components > 1 && value !== void 0 ? Array.from(value) : value;
285
280
  if (!wants.has(JSON.stringify(have))) {
@@ -288,6 +283,19 @@ function staleGraphicsRows(column, table, domain) {
288
283
  }
289
284
  return stale;
290
285
  }
286
+ function wantedGraphics(trees, domain, field, r) {
287
+ const wants = /* @__PURE__ */ new Set();
288
+ for (const tree of trees) {
289
+ const want = graphicsValues(domain, tree.values[r]).find(([f]) => f === field);
290
+ if (want !== void 0) {
291
+ wants.add(JSON.stringify(want[1]));
292
+ }
293
+ }
294
+ if (wants.size === 0) {
295
+ wants.add(JSON.stringify(void 0));
296
+ }
297
+ return wants;
298
+ }
291
299
  function graphicsValues(domain, tree, unmapped = []) {
292
300
  const out = [];
293
301
  if (domain === "node") {
@@ -1095,6 +1103,26 @@ ${indent}<data key="${keyId}">`);
1095
1103
  out.push(`
1096
1104
  ${indent}</data>`);
1097
1105
  }
1106
+ function pushDefault(key, column, inner, parts) {
1107
+ if (key.yfilesType === null) {
1108
+ parts.push(`
1109
+ ${inner}<default>${escapeXmlText(defaultText(column, key.attrType) ?? "")}</default>`);
1110
+ return;
1111
+ }
1112
+ const value = column.meta.default;
1113
+ if (value !== null && typeof value === "object" && !Array.isArray(value)) {
1114
+ parts.push(`
1115
+ ${inner}<default>`);
1116
+ writeXmlTree(value, `${inner} `, parts);
1117
+ parts.push(`
1118
+ ${inner}</default>`);
1119
+ } else {
1120
+ const tree = [];
1121
+ writeXmlTree(value, inner, tree);
1122
+ parts.push(`
1123
+ ${inner}<default>${tree.join("")}</default>`);
1124
+ }
1125
+ }
1098
1126
  function keyElement(key, indent) {
1099
1127
  const domain = key.domains.length === 3 ? "all" : key.domains[0];
1100
1128
  let text2 = `${indent}<key id="${escapeXmlAttribute(key.id)}" for="${domain}"`;
@@ -1121,24 +1149,7 @@ function keyElement(key, indent) {
1121
1149
  ${inner}<desc>${escapeXmlText(desc)}</desc>`);
1122
1150
  }
1123
1151
  if (hasDefault) {
1124
- if (key.yfilesType !== null) {
1125
- const value = column.meta.default;
1126
- if (value !== null && typeof value === "object" && !Array.isArray(value)) {
1127
- parts.push(`
1128
- ${inner}<default>`);
1129
- writeXmlTree(value, `${inner} `, parts);
1130
- parts.push(`
1131
- ${inner}</default>`);
1132
- } else {
1133
- const tree = [];
1134
- writeXmlTree(value, inner, tree);
1135
- parts.push(`
1136
- ${inner}<default>${tree.join("")}</default>`);
1137
- }
1138
- } else {
1139
- parts.push(`
1140
- ${inner}<default>${escapeXmlText(defaultText(column, key.attrType) ?? "")}</default>`);
1141
- }
1152
+ pushDefault(key, column, inner, parts);
1142
1153
  }
1143
1154
  parts.push(`
1144
1155
  ${indent}</key>
@@ -1228,11 +1239,13 @@ ${i2}<desc>${escapeXmlText(description)}</desc>`;
1228
1239
  }
1229
1240
  const { hierarchy } = plan;
1230
1241
  const nested = hierarchy.childList.length > 0;
1231
- const stackNode = [];
1232
- const stackCursor = [];
1233
- const written = nested ? new Uint8Array(snapshot.nodeCount) : null;
1242
+ const walk = {
1243
+ stackNode: [],
1244
+ stackCursor: [],
1245
+ written: nested ? new Uint8Array(snapshot.nodeCount) : null
1246
+ };
1234
1247
  for (const rootNode of hierarchy.roots) {
1235
- yield* writeNodeSubtree(rootNode, plan, ids, i2, step, stackNode, stackCursor, written);
1248
+ yield* writeNodeSubtree(rootNode, plan, ids, i2, step, walk);
1236
1249
  }
1237
1250
  const list = snapshot.edgeList();
1238
1251
  const { folding } = plan;
@@ -1294,7 +1307,8 @@ function portText(column, e) {
1294
1307
  const value = column.value(e);
1295
1308
  return typeof value === "string" ? value : String(value);
1296
1309
  }
1297
- function* writeNodeSubtree(root, plan, ids, indent, step, stackNode, stackCursor, written) {
1310
+ function* writeNodeSubtree(root, plan, ids, indent, step, walk) {
1311
+ const { stackNode, stackCursor, written } = walk;
1298
1312
  const { hierarchy } = plan;
1299
1313
  const hasChildren = (u) => hierarchy.childStart[u + 1] > hierarchy.childStart[u];
1300
1314
  const openNode = (u, depth) => {
@@ -2185,9 +2199,6 @@ class GraphmlReader {
2185
2199
  * @param line - the line
2186
2200
  */
2187
2201
  reportUnreadAttributes(kind, attrs, known, line) {
2188
- if (attrs.size === 0) {
2189
- return;
2190
- }
2191
2202
  for (const name of attrs.keys()) {
2192
2203
  if (known.has(name) || name === "xmlns" || /^(xmlns|xml|xsi):/.test(name)) {
2193
2204
  continue;
@@ -2209,14 +2220,7 @@ class GraphmlReader {
2209
2220
  if (names.size > MAX_UNKNOWN_ATTRIBUTE_NAMES && !hint2) {
2210
2221
  continue;
2211
2222
  }
2212
- let message;
2213
- if (hint2) {
2214
- message = `the <${kind}> parse hint ${name} is ignored`;
2215
- } else if (SCHEMA_ATTRIBUTES.has(name)) {
2216
- message = `the <${kind}> attribute ${name} is not kept`;
2217
- } else {
2218
- message = `the <${kind}> attribute ${name} is not a GraphML attribute; it is not kept`;
2219
- }
2223
+ const message = unreadAttributeMessage(kind, name, hint2);
2220
2224
  this.report.warning("unsupported", code, message, { line, element: name });
2221
2225
  }
2222
2226
  }
@@ -3691,8 +3695,17 @@ function unknownElementMessage(name) {
3691
3695
  }
3692
3696
  return GRAPHML_ELEMENTS.has(name) ? `element <${name}> is not allowed at this place in a GraphML file and was skipped` : `element <${name}> is not GraphML and was skipped`;
3693
3697
  }
3698
+ function unreadAttributeMessage(kind, name, hint2) {
3699
+ if (hint2) {
3700
+ return `the <${kind}> parse hint ${name} is ignored`;
3701
+ }
3702
+ if (SCHEMA_ATTRIBUTES.has(name)) {
3703
+ return `the <${kind}> attribute ${name} is not kept`;
3704
+ }
3705
+ return `the <${kind}> attribute ${name} is not a GraphML attribute; it is not kept`;
3706
+ }
3694
3707
  export {
3695
3708
  graphmlImporter as a,
3696
3709
  graphmlExporter as g
3697
3710
  };
3698
- //# sourceMappingURL=importer-BpuS3J8C.js.map
3711
+ //# sourceMappingURL=importer-BmaZcskq.js.map