@graphty/graph-io 0.3.40 → 0.3.42
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -0
- package/dist/chunks/{children-CL3Cy0ez.js → children-CA4coBi0.js} +36 -27
- package/dist/chunks/children-CA4coBi0.js.map +1 -0
- package/dist/chunks/{choose-CS3fvGT1.js → choose-DvpbdRuz.js} +2 -2
- package/dist/chunks/{choose-CS3fvGT1.js.map → choose-DvpbdRuz.js.map} +1 -1
- package/dist/chunks/{constants-DqKZT6cH.js → constants-fT3E8JYY.js} +2 -2
- package/dist/chunks/{constants-DqKZT6cH.js.map → constants-fT3E8JYY.js.map} +1 -1
- package/dist/chunks/{escape-BJRLd3vJ.js → escape-B62ZGM_a.js} +2 -2
- package/dist/chunks/{escape-BJRLd3vJ.js.map → escape-B62ZGM_a.js.map} +1 -1
- package/dist/chunks/{export-B-aVCwyG.js → export-rKLeGQMo.js} +404 -243
- package/dist/chunks/export-rKLeGQMo.js.map +1 -0
- package/dist/chunks/{exporter-6ocL_9x_.js → exporter-8hLNemFk.js} +4 -4
- package/dist/chunks/{exporter-6ocL_9x_.js.map → exporter-8hLNemFk.js.map} +1 -1
- package/dist/chunks/{exporter-BVXnV9-9.js → exporter-BWwEuOPT.js} +29 -17
- package/dist/chunks/exporter-BWwEuOPT.js.map +1 -0
- package/dist/chunks/{exporter-Bcp-l4Bo.js → exporter-CpRyHZ3H.js} +574 -475
- package/dist/chunks/exporter-CpRyHZ3H.js.map +1 -0
- package/dist/chunks/{exporter-SFYkDzD0.js → exporter-yLxKBvLE.js} +23 -20
- package/dist/chunks/{exporter-SFYkDzD0.js.map → exporter-yLxKBvLE.js.map} +1 -1
- package/dist/chunks/{importer-DcKB97kW.js → importer-BbNb7eNg.js} +111 -71
- package/dist/chunks/importer-BbNb7eNg.js.map +1 -0
- package/dist/chunks/{importer-D_srHyj6.js → importer-C98dpSH4.js} +5 -5
- package/dist/chunks/{importer-D_srHyj6.js.map → importer-C98dpSH4.js.map} +1 -1
- package/dist/chunks/{importer-BJlGAOht.js → importer-D794XUTe.js} +3 -3
- package/dist/chunks/{importer-BJlGAOht.js.map → importer-D794XUTe.js.map} +1 -1
- package/dist/chunks/{importer-AjwOJrn2.js → importer-Dz7tI8Sa.js} +202 -181
- package/dist/chunks/importer-Dz7tI8Sa.js.map +1 -0
- package/dist/chunks/{importer-DEp_fYjf.js → importer-Ht7LNg8L.js} +92 -64
- package/dist/chunks/importer-Ht7LNg8L.js.map +1 -0
- package/dist/chunks/{importer-CPqnIY8m.js → importer-WrGRZb0N.js} +42 -29
- package/dist/chunks/importer-WrGRZb0N.js.map +1 -0
- package/dist/chunks/{importer-BpuS3J8C.js → importer-xZ-3suY1.js} +74 -61
- package/dist/chunks/importer-xZ-3suY1.js.map +1 -0
- package/dist/chunks/{json-elements-DpO6AXIc.js → json-elements-DKSqpNW1.js} +3 -3
- package/dist/chunks/{json-elements-DpO6AXIc.js.map → json-elements-DKSqpNW1.js.map} +1 -1
- package/dist/chunks/{ontology-export-50L9DOV4.js → ontology-export-CtRXjg_i.js} +2 -2
- package/dist/chunks/{ontology-export-50L9DOV4.js.map → ontology-export-CtRXjg_i.js.map} +1 -1
- package/dist/chunks/{records-r3SFHz11.js → records-Cu4bxYOm.js} +69 -36
- package/dist/chunks/records-Cu4bxYOm.js.map +1 -0
- package/dist/chunks/{text-Bjfa1xYL.js → text-DHOJXnED.js} +20 -11
- package/dist/chunks/text-DHOJXnED.js.map +1 -0
- package/dist/csv.js +323 -241
- package/dist/csv.js.map +1 -1
- package/dist/cx.js +1 -1
- package/dist/cx2.js +2 -2
- package/dist/cys.js +1 -1
- package/dist/dot.js +1 -1
- package/dist/gexf.js +195 -97
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +170 -149
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +27 -27
- package/dist/graphml.js +2 -2
- package/dist/json.js +1 -1
- package/dist/neo4j.js +103 -65
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +1 -1
- package/dist/src/children.d.ts.map +1 -1
- package/dist/src/children.js +50 -27
- package/dist/src/children.js.map +1 -1
- package/dist/src/common/attributes.d.ts.map +1 -1
- package/dist/src/common/attributes.js +86 -42
- package/dist/src/common/attributes.js.map +1 -1
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +358 -184
- package/dist/src/common/input.js.map +1 -1
- package/dist/src/common/lists.js +30 -15
- package/dist/src/common/lists.js.map +1 -1
- package/dist/src/common/text.d.ts +7 -0
- package/dist/src/common/text.d.ts.map +1 -1
- package/dist/src/common/text.js +15 -7
- package/dist/src/common/text.js.map +1 -1
- package/dist/src/common/zip.d.ts.map +1 -1
- package/dist/src/common/zip.js +36 -19
- package/dist/src/common/zip.js.map +1 -1
- package/dist/src/formats/csv/exporter.d.ts.map +1 -1
- package/dist/src/formats/csv/exporter.js +288 -146
- package/dist/src/formats/csv/exporter.js.map +1 -1
- package/dist/src/formats/csv/importer.d.ts.map +1 -1
- package/dist/src/formats/csv/importer.js +129 -80
- package/dist/src/formats/csv/importer.js.map +1 -1
- package/dist/src/formats/csv/records.d.ts.map +1 -1
- package/dist/src/formats/csv/records.js +78 -36
- package/dist/src/formats/csv/records.js.map +1 -1
- package/dist/src/formats/cys/tables.d.ts.map +1 -1
- package/dist/src/formats/cys/tables.js +11 -8
- package/dist/src/formats/cys/tables.js.map +1 -1
- package/dist/src/formats/dot/tokenizer.d.ts +39 -0
- package/dist/src/formats/dot/tokenizer.d.ts.map +1 -1
- package/dist/src/formats/dot/tokenizer.js +112 -66
- package/dist/src/formats/dot/tokenizer.js.map +1 -1
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
- package/dist/src/formats/gexf/exporter.js +65 -37
- package/dist/src/formats/gexf/exporter.js.map +1 -1
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +138 -50
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gml/exporter.d.ts.map +1 -1
- package/dist/src/formats/gml/exporter.js +51 -35
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/gml/importer.d.ts.map +1 -1
- package/dist/src/formats/gml/importer.js +103 -58
- package/dist/src/formats/gml/importer.js.map +1 -1
- package/dist/src/formats/gml/syntax.d.ts.map +1 -1
- package/dist/src/formats/gml/syntax.js +17 -8
- package/dist/src/formats/gml/syntax.js.map +1 -1
- package/dist/src/formats/graphml/exporter.d.ts.map +1 -1
- package/dist/src/formats/graphml/exporter.js +34 -24
- package/dist/src/formats/graphml/exporter.js.map +1 -1
- package/dist/src/formats/graphml/importer.d.ts.map +1 -1
- package/dist/src/formats/graphml/importer.js +17 -13
- package/dist/src/formats/graphml/importer.js.map +1 -1
- package/dist/src/formats/graphml/tree.js +23 -14
- package/dist/src/formats/graphml/tree.js.map +1 -1
- package/dist/src/formats/graphml/yfiles.d.ts.map +1 -1
- package/dist/src/formats/graphml/yfiles.js +22 -10
- package/dist/src/formats/graphml/yfiles.js.map +1 -1
- package/dist/src/formats/json/dialect.d.ts.map +1 -1
- package/dist/src/formats/json/dialect.js +54 -20
- package/dist/src/formats/json/dialect.js.map +1 -1
- package/dist/src/formats/json/exporter.d.ts.map +1 -1
- package/dist/src/formats/json/exporter.js +38 -21
- package/dist/src/formats/json/exporter.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +536 -343
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/json/obographs.js +29 -17
- package/dist/src/formats/json/obographs.js.map +1 -1
- package/dist/src/formats/neo4j/exporter.d.ts.map +1 -1
- package/dist/src/formats/neo4j/exporter.js +73 -43
- package/dist/src/formats/neo4j/exporter.js.map +1 -1
- package/dist/src/formats/neo4j/header.d.ts.map +1 -1
- package/dist/src/formats/neo4j/header.js +37 -16
- package/dist/src/formats/neo4j/header.js.map +1 -1
- package/dist/src/formats/neo4j/importer.d.ts.map +1 -1
- package/dist/src/formats/neo4j/importer.js +21 -11
- package/dist/src/formats/neo4j/importer.js.map +1 -1
- package/dist/src/formats/obo/exporter.d.ts.map +1 -1
- package/dist/src/formats/obo/exporter.js +18 -7
- package/dist/src/formats/obo/exporter.js.map +1 -1
- package/dist/src/formats/pajek/exporter.d.ts.map +1 -1
- package/dist/src/formats/pajek/exporter.js +142 -73
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/pajek/importer.d.ts.map +1 -1
- package/dist/src/formats/pajek/importer.js +26 -15
- package/dist/src/formats/pajek/importer.js.map +1 -1
- package/dist/src/formats/pajek/syntax.d.ts.map +1 -1
- package/dist/src/formats/pajek/syntax.js +85 -58
- package/dist/src/formats/pajek/syntax.js.map +1 -1
- package/dist/src/formats/xgmml/emit.d.ts +7 -0
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -1
- package/dist/src/formats/xgmml/emit.js +79 -40
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/exporter.d.ts.map +1 -1
- package/dist/src/formats/xgmml/exporter.js +38 -12
- package/dist/src/formats/xgmml/exporter.js.map +1 -1
- package/dist/src/formats/xgmml/importer.d.ts.map +1 -1
- package/dist/src/formats/xgmml/importer.js +38 -18
- package/dist/src/formats/xgmml/importer.js.map +1 -1
- package/dist/src/sniff.js +109 -57
- package/dist/src/sniff.js.map +1 -1
- package/dist/xgmml.js +2 -2
- package/package.json +2 -2
- package/src/children.ts +54 -27
- package/src/common/attributes.ts +118 -49
- package/src/common/input.ts +439 -197
- package/src/common/lists.ts +29 -15
- package/src/common/text.ts +24 -15
- package/src/common/zip.ts +47 -18
- package/src/formats/csv/exporter.ts +377 -175
- package/src/formats/csv/importer.ts +155 -84
- package/src/formats/csv/records.ts +90 -35
- package/src/formats/cys/tables.ts +11 -10
- package/src/formats/dot/tokenizer.ts +118 -68
- package/src/formats/gexf/exporter.ts +67 -36
- package/src/formats/gexf/importer.ts +173 -63
- package/src/formats/gml/exporter.ts +78 -82
- package/src/formats/gml/importer.ts +119 -68
- package/src/formats/gml/syntax.ts +18 -8
- package/src/formats/graphml/exporter.ts +44 -24
- package/src/formats/graphml/importer.ts +18 -11
- package/src/formats/graphml/tree.ts +22 -12
- package/src/formats/graphml/yfiles.ts +23 -10
- package/src/formats/json/dialect.ts +61 -22
- package/src/formats/json/exporter.ts +40 -21
- package/src/formats/json/importer.ts +701 -385
- package/src/formats/json/obographs.ts +35 -15
- package/src/formats/neo4j/exporter.ts +79 -41
- package/src/formats/neo4j/header.ts +50 -16
- package/src/formats/neo4j/importer.ts +21 -10
- package/src/formats/obo/exporter.ts +34 -17
- package/src/formats/pajek/exporter.ts +180 -117
- package/src/formats/pajek/importer.ts +27 -15
- package/src/formats/pajek/syntax.ts +99 -58
- package/src/formats/xgmml/emit.ts +88 -40
- package/src/formats/xgmml/exporter.ts +40 -12
- package/src/formats/xgmml/importer.ts +45 -23
- package/src/sniff.ts +115 -59
- package/dist/chunks/children-CL3Cy0ez.js.map +0 -1
- package/dist/chunks/export-B-aVCwyG.js.map +0 -1
- package/dist/chunks/exporter-BVXnV9-9.js.map +0 -1
- package/dist/chunks/exporter-Bcp-l4Bo.js.map +0 -1
- package/dist/chunks/importer-AjwOJrn2.js.map +0 -1
- package/dist/chunks/importer-BpuS3J8C.js.map +0 -1
- package/dist/chunks/importer-CPqnIY8m.js.map +0 -1
- package/dist/chunks/importer-DEp_fYjf.js.map +0 -1
- package/dist/chunks/importer-DcKB97kW.js.map +0 -1
- package/dist/chunks/records-r3SFHz11.js.map +0 -1
- 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
|
-
import { c as childrenCsr } from "./children-
|
|
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-
|
|
4
|
-
import {
|
|
2
|
+
import { c as childrenCsr } from "./children-CA4coBi0.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-rKLeGQMo.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-B62ZGM_a.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-
|
|
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-fT3E8JYY.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
|
-
|
|
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 =
|
|
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
|
-
|
|
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
|
|
1232
|
-
|
|
1233
|
-
|
|
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,
|
|
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,
|
|
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
|
-
|
|
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-
|
|
3711
|
+
//# sourceMappingURL=importer-xZ-3suY1.js.map
|