@graphty/graph-io 0.3.35 → 0.3.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/{choose-494CpuXQ.js → choose-CsO24U-5.js} +2 -2
- package/dist/chunks/{choose-494CpuXQ.js.map → choose-CsO24U-5.js.map} +1 -1
- package/dist/chunks/{constants-BBK4rsQZ.js → constants-BPRiVyBu.js} +2 -2
- package/dist/chunks/{constants-BBK4rsQZ.js.map → constants-BPRiVyBu.js.map} +1 -1
- package/dist/chunks/{escape-wVIEtLv6.js → escape-BRcyzD77.js} +4 -4
- package/dist/chunks/{escape-wVIEtLv6.js.map → escape-BRcyzD77.js.map} +1 -1
- package/dist/chunks/{export-Cbt4h_0n.js → export-CTUlibzr.js} +4 -4
- package/dist/chunks/export-CTUlibzr.js.map +1 -0
- package/dist/chunks/{exporter-CkPnJCXU.js → exporter-2UNIxzcu.js} +3 -3
- package/dist/chunks/{exporter-CkPnJCXU.js.map → exporter-2UNIxzcu.js.map} +1 -1
- package/dist/chunks/{exporter-LZTIAzkS.js → exporter-B_YFZ4ix.js} +8 -8
- package/dist/chunks/exporter-B_YFZ4ix.js.map +1 -0
- package/dist/chunks/{exporter-CqnmKk-f.js → exporter-Bn4jdYfd.js} +5 -5
- package/dist/chunks/{exporter-CqnmKk-f.js.map → exporter-Bn4jdYfd.js.map} +1 -1
- package/dist/chunks/{exporter-DMxRy-0l.js → exporter-flsHFoER.js} +4 -4
- package/dist/chunks/{exporter-DMxRy-0l.js.map → exporter-flsHFoER.js.map} +1 -1
- package/dist/chunks/{importer-C1VMuEBQ.js → importer-BD3mi2QH.js} +10 -10
- package/dist/chunks/importer-BD3mi2QH.js.map +1 -0
- package/dist/chunks/{importer-DvPvd4Yy.js → importer-Bgb9sgZZ.js} +9 -9
- package/dist/chunks/importer-Bgb9sgZZ.js.map +1 -0
- package/dist/chunks/{importer-CSmH218L.js → importer-CEuUmyPe.js} +10 -10
- package/dist/chunks/importer-CEuUmyPe.js.map +1 -0
- package/dist/chunks/{importer-DMgcD1wI.js → importer-DqMtyYLX.js} +11 -11
- package/dist/chunks/importer-DqMtyYLX.js.map +1 -0
- package/dist/chunks/{importer-BTSvNJUB.js → importer-Dwqepe_B.js} +3 -3
- package/dist/chunks/{importer-BTSvNJUB.js.map → importer-Dwqepe_B.js.map} +1 -1
- package/dist/chunks/{importer-BTbjwN10.js → importer-oIUx9u_g.js} +9 -9
- package/dist/chunks/importer-oIUx9u_g.js.map +1 -0
- package/dist/chunks/{importer-DtKPzhVp.js → importer-yWUPR_nU.js} +13 -13
- package/dist/chunks/importer-yWUPR_nU.js.map +1 -0
- package/dist/chunks/{json-elements-CxJF-Szz.js → json-elements-AkglPS3m.js} +4 -4
- package/dist/chunks/json-elements-AkglPS3m.js.map +1 -0
- package/dist/chunks/{ontology-export-p1PsPenq.js → ontology-export-DDoG3egY.js} +2 -2
- package/dist/chunks/{ontology-export-p1PsPenq.js.map → ontology-export-DDoG3egY.js.map} +1 -1
- package/dist/chunks/{records-BrfHycmg.js → records-ChmWZGuz.js} +2 -2
- package/dist/chunks/{records-BrfHycmg.js.map → records-ChmWZGuz.js.map} +1 -1
- package/dist/chunks/{text-BD-TzLNm.js → text-Btw3sBe_.js} +2 -2
- package/dist/chunks/{text-BD-TzLNm.js.map → text-Btw3sBe_.js.map} +1 -1
- package/dist/csv.js +4 -4
- 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 +30 -30
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +8 -8
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +28 -28
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +2 -2
- package/dist/json.js +1 -1
- package/dist/neo4j.js +6 -6
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +1 -1
- package/dist/src/common/attributes.d.ts +1 -2
- package/dist/src/common/attributes.d.ts.map +1 -1
- package/dist/src/common/attributes.js +2 -2
- package/dist/src/common/attributes.js.map +1 -1
- package/dist/src/common/direction.d.ts +1 -2
- package/dist/src/common/direction.d.ts.map +1 -1
- package/dist/src/common/direction.js +2 -2
- package/dist/src/common/direction.js.map +1 -1
- package/dist/src/common/escape.js +1 -1
- package/dist/src/common/escape.js.map +1 -1
- package/dist/src/common/export.js +1 -1
- package/dist/src/common/export.js.map +1 -1
- package/dist/src/common/ids.d.ts +1 -2
- package/dist/src/common/ids.d.ts.map +1 -1
- package/dist/src/common/ids.js +1 -2
- package/dist/src/common/ids.js.map +1 -1
- package/dist/src/common/input.d.ts +1 -2
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +2 -2
- package/dist/src/common/input.js.map +1 -1
- package/dist/src/common/json-elements.js +1 -1
- package/dist/src/common/json-elements.js.map +1 -1
- package/dist/src/common/options.d.ts +1 -2
- package/dist/src/common/options.d.ts.map +1 -1
- package/dist/src/common/options.js +1 -1
- package/dist/src/common/options.js.map +1 -1
- package/dist/src/common/xml.js +1 -1
- package/dist/src/common/xml.js.map +1 -1
- package/dist/src/formats/cx/importer.js +6 -6
- package/dist/src/formats/cx/importer.js.map +1 -1
- package/dist/src/formats/cys/importer.js +3 -3
- package/dist/src/formats/cys/importer.js.map +1 -1
- package/dist/src/formats/cys/tables.js +1 -1
- package/dist/src/formats/cys/tables.js.map +1 -1
- package/dist/src/formats/dot/exporter.js +3 -3
- package/dist/src/formats/dot/exporter.js.map +1 -1
- package/dist/src/formats/dot/importer.js +1 -1
- package/dist/src/formats/dot/importer.js.map +1 -1
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
- package/dist/src/formats/gexf/exporter.js +24 -27
- package/dist/src/formats/gexf/exporter.js.map +1 -1
- package/dist/src/formats/gexf/importer.d.ts +1 -2
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +5 -5
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gml/exporter.js +4 -4
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/gml/syntax.js +1 -1
- package/dist/src/formats/gml/syntax.js.map +1 -1
- package/dist/src/formats/graphml/exporter.js +3 -3
- package/dist/src/formats/graphml/exporter.js.map +1 -1
- package/dist/src/formats/graphml/importer.js +2 -2
- package/dist/src/formats/graphml/importer.js.map +1 -1
- package/dist/src/formats/graphml/tree.js +2 -2
- package/dist/src/formats/graphml/tree.js.map +1 -1
- package/dist/src/formats/json/exporter.js +1 -1
- package/dist/src/formats/json/exporter.js.map +1 -1
- package/dist/src/formats/json/importer.js +1 -1
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/formats/neo4j/exporter.js +3 -3
- package/dist/src/formats/neo4j/exporter.js.map +1 -1
- package/dist/src/formats/pajek/exporter.js +4 -4
- package/dist/src/formats/pajek/exporter.js.map +1 -1
- package/dist/src/formats/xgmml/document.js +6 -6
- package/dist/src/formats/xgmml/document.js.map +1 -1
- package/dist/src/formats/xgmml/emit.js +2 -2
- package/dist/src/formats/xgmml/emit.js.map +1 -1
- package/dist/src/formats/xgmml/exporter.js +1 -1
- package/dist/src/formats/xgmml/exporter.js.map +1 -1
- package/dist/src/formats/xgmml/importer.js +1 -1
- package/dist/src/formats/xgmml/importer.js.map +1 -1
- package/dist/src/registry.js +2 -2
- package/dist/src/registry.js.map +1 -1
- package/dist/src/sniff.js +1 -1
- package/dist/src/sniff.js.map +1 -1
- package/dist/xgmml.js +2 -2
- package/package.json +2 -2
- package/src/common/attributes.ts +1 -2
- package/src/common/direction.ts +2 -2
- package/src/common/escape.ts +1 -1
- package/src/common/export.ts +1 -1
- package/src/common/ids.ts +1 -3
- package/src/common/input.ts +2 -2
- package/src/common/json-elements.ts +1 -1
- package/src/common/options.ts +1 -1
- package/src/common/xml.ts +1 -1
- package/src/formats/cx/importer.ts +6 -6
- package/src/formats/cys/importer.ts +3 -3
- package/src/formats/cys/tables.ts +1 -1
- package/src/formats/dot/exporter.ts +3 -3
- package/src/formats/dot/importer.ts +1 -1
- package/src/formats/gexf/exporter.ts +24 -28
- package/src/formats/gexf/importer.ts +5 -5
- package/src/formats/gml/exporter.ts +4 -4
- package/src/formats/gml/syntax.ts +1 -1
- package/src/formats/graphml/exporter.ts +3 -3
- package/src/formats/graphml/importer.ts +2 -2
- package/src/formats/graphml/tree.ts +2 -2
- package/src/formats/json/exporter.ts +1 -1
- package/src/formats/json/importer.ts +1 -1
- package/src/formats/neo4j/exporter.ts +3 -3
- package/src/formats/pajek/exporter.ts +4 -4
- package/src/formats/xgmml/document.ts +6 -6
- package/src/formats/xgmml/emit.ts +2 -2
- package/src/formats/xgmml/exporter.ts +1 -1
- package/src/formats/xgmml/importer.ts +1 -1
- package/src/registry.ts +2 -2
- package/src/sniff.ts +1 -1
- package/dist/chunks/export-Cbt4h_0n.js.map +0 -1
- package/dist/chunks/exporter-LZTIAzkS.js.map +0 -1
- package/dist/chunks/importer-BTbjwN10.js.map +0 -1
- package/dist/chunks/importer-C1VMuEBQ.js.map +0 -1
- package/dist/chunks/importer-CSmH218L.js.map +0 -1
- package/dist/chunks/importer-DMgcD1wI.js.map +0 -1
- package/dist/chunks/importer-DtKPzhVp.js.map +0 -1
- package/dist/chunks/importer-DvPvd4Yy.js.map +0 -1
- package/dist/chunks/json-elements-CxJF-Szz.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { INVALID_INDEX, GraphFormatError } from "@graphty/graph-format";
|
|
2
|
-
import { M as MIXED_DIRECTION_CODE, D as DIRECTION_FORCED_CODE, d as DIRECTION_REFUSED_CODE, S as SINK_OPTION_CODE, O as OPTION_IGNORED_CODE, I as ID_MERGED_CODE, R as ROLE_TAKEN_CODE, C as COLUMN_RENAMED_CODE, ae as AMBIGUOUS_GRAPH_NAME_CODE, af as GRAPH_NOT_FOUND_CODE, l as MULTIPLE_GRAPHS_CODE, f as STRAY_TEXT_CODE, g as UNKNOWN_ELEMENT_CODE, U as UNKNOWN_ATTR_TYPE_CODE, b6 as EQUATION_AS_TEXT_CODE, ai as PARENT_CYCLE_CODE, q as UNKNOWN_PARENT_CODE, o as DUPLICATE_ATTRIBUTE_CODE, i as DANGLING_REFERENCE_CODE, P as PRECISION_CODE, aj as WIDENED_CODE, a3 as BAD_VALUE_CODE, m as DUPLICATE_EDGE_ID_CODE, n as DUPLICATE_NODE_CODE, s as MISSING_ENDPOINT_CODE, t as MISSING_ID_CODE, N as NO_GRAPH_CODE, v as ENCODING_CONFLICT_CODE, w as UNKNOWN_ENCODING_CODE, x as ENCODING_FALLBACK_CODE, y as INVALID_ENCODING_CODE, z as INVALID_UTF8_CODE, E as EMPTY_INPUT_CODE, X as XML_SYNTAX_CODE, F as ELEMENT_ISSUE, G as INPUT_ISSUE, bj as STORAGE_CLASS_CODE, bp as WEIGHT_KEY_CLASH_CODE, au as ROLE_ASSUMED_CODE, a$ as COLUMN_RENAMED_LOSS_CODE, J as ID_TEXT_TYPE_CODE, bc as MUTUAL_EXPANDED_CODE, Q as PARENTS_DROPPED_CODE, K as ROLE_DROPPED_CODE, bl as TEMPORAL_TEXT_DROPPED_CODE, bk as TEMPORAL_DROPPED_CODE, ax as XML_ILLEGAL_CHAR_CODE, a0 as uniqueColumnName, a1 as declareResolved, ac as DictHeuristic, ar as IdCoercer, aq as DirectionResolver, b as plural, $ as agree, am as throwIfAborted, aK as parseWeightText, ao as reportSinkOptions, an as reportUnusedOptions, a7 as chooseGraph, ap as graphChosen, al as resolveImportOptions, a8 as ImportReportBuilder, a4 as textChunks, c0 as elementCount } from "./export-
|
|
3
|
-
import { l as localName, a as escapeXmlText, j as isWhitespace, e as escapeXmlAttribute, t as tokenizeXml, f as xmlDeclaredEncoding, X as XmlSyntaxError } from "./escape-
|
|
4
|
-
import { p as parseTextCell, i as inferTextDtype } from "./text-
|
|
2
|
+
import { M as MIXED_DIRECTION_CODE, D as DIRECTION_FORCED_CODE, d as DIRECTION_REFUSED_CODE, S as SINK_OPTION_CODE, O as OPTION_IGNORED_CODE, I as ID_MERGED_CODE, R as ROLE_TAKEN_CODE, C as COLUMN_RENAMED_CODE, ae as AMBIGUOUS_GRAPH_NAME_CODE, af as GRAPH_NOT_FOUND_CODE, l as MULTIPLE_GRAPHS_CODE, f as STRAY_TEXT_CODE, g as UNKNOWN_ELEMENT_CODE, U as UNKNOWN_ATTR_TYPE_CODE, b6 as EQUATION_AS_TEXT_CODE, ai as PARENT_CYCLE_CODE, q as UNKNOWN_PARENT_CODE, o as DUPLICATE_ATTRIBUTE_CODE, i as DANGLING_REFERENCE_CODE, P as PRECISION_CODE, aj as WIDENED_CODE, a3 as BAD_VALUE_CODE, m as DUPLICATE_EDGE_ID_CODE, n as DUPLICATE_NODE_CODE, s as MISSING_ENDPOINT_CODE, t as MISSING_ID_CODE, N as NO_GRAPH_CODE, v as ENCODING_CONFLICT_CODE, w as UNKNOWN_ENCODING_CODE, x as ENCODING_FALLBACK_CODE, y as INVALID_ENCODING_CODE, z as INVALID_UTF8_CODE, E as EMPTY_INPUT_CODE, X as XML_SYNTAX_CODE, F as ELEMENT_ISSUE, G as INPUT_ISSUE, bj as STORAGE_CLASS_CODE, bp as WEIGHT_KEY_CLASH_CODE, au as ROLE_ASSUMED_CODE, a$ as COLUMN_RENAMED_LOSS_CODE, J as ID_TEXT_TYPE_CODE, bc as MUTUAL_EXPANDED_CODE, Q as PARENTS_DROPPED_CODE, K as ROLE_DROPPED_CODE, bl as TEMPORAL_TEXT_DROPPED_CODE, bk as TEMPORAL_DROPPED_CODE, ax as XML_ILLEGAL_CHAR_CODE, a0 as uniqueColumnName, a1 as declareResolved, ac as DictHeuristic, ar as IdCoercer, aq as DirectionResolver, b as plural, $ as agree, am as throwIfAborted, aK as parseWeightText, ao as reportSinkOptions, an as reportUnusedOptions, a7 as chooseGraph, ap as graphChosen, al as resolveImportOptions, a8 as ImportReportBuilder, a4 as textChunks, c0 as elementCount } from "./export-CTUlibzr.js";
|
|
3
|
+
import { l as localName, a as escapeXmlText, j as isWhitespace, e as escapeXmlAttribute, t as tokenizeXml, f as xmlDeclaredEncoding, X as XmlSyntaxError } from "./escape-BRcyzD77.js";
|
|
4
|
+
import { p as parseTextCell, i as inferTextDtype } from "./text-Btw3sBe_.js";
|
|
5
5
|
const FORMAT = "xgmml";
|
|
6
6
|
const EXTENSIONS = Object.freeze([".xgmml", ".xml"]);
|
|
7
7
|
const MIME_TYPES = Object.freeze(["application/xgmml", "text/xgmml", "text/xgmml+xml"]);
|
|
@@ -317,7 +317,7 @@ class XgmmlParser {
|
|
|
317
317
|
*/
|
|
318
318
|
start(rawName, rawAttrs, line) {
|
|
319
319
|
this.enterScope(rawAttrs);
|
|
320
|
-
const top = this.frames.
|
|
320
|
+
const top = this.frames.at(-1) ?? null;
|
|
321
321
|
if (top === null) {
|
|
322
322
|
this.startRoot(rawName, rawAttrs, line);
|
|
323
323
|
return;
|
|
@@ -370,7 +370,7 @@ class XgmmlParser {
|
|
|
370
370
|
end(name, _line) {
|
|
371
371
|
this.scopes.pop();
|
|
372
372
|
const frame = this.frames.pop();
|
|
373
|
-
const below = this.frames.
|
|
373
|
+
const below = this.frames.at(-1) ?? null;
|
|
374
374
|
switch (frame?.kind) {
|
|
375
375
|
case "capture":
|
|
376
376
|
frame.att.xml = `${frame.att.xml ?? ""}</${name}>`;
|
|
@@ -393,7 +393,7 @@ class XgmmlParser {
|
|
|
393
393
|
return;
|
|
394
394
|
case "line":
|
|
395
395
|
if (below?.kind === "graphics") {
|
|
396
|
-
below.target.graphics = { ...below.target.graphics
|
|
396
|
+
below.target.graphics = { ...below.target.graphics, Line: frame.points };
|
|
397
397
|
}
|
|
398
398
|
return;
|
|
399
399
|
}
|
|
@@ -404,7 +404,7 @@ class XgmmlParser {
|
|
|
404
404
|
* @param line - the line
|
|
405
405
|
*/
|
|
406
406
|
text(text, line) {
|
|
407
|
-
const top = this.frames.
|
|
407
|
+
const top = this.frames.at(-1) ?? null;
|
|
408
408
|
if (top === null || top.kind === "skip") {
|
|
409
409
|
return;
|
|
410
410
|
}
|
|
@@ -872,7 +872,7 @@ class XgmmlParser {
|
|
|
872
872
|
* @param line - the line
|
|
873
873
|
*/
|
|
874
874
|
beginGraphics(target, attrs, line) {
|
|
875
|
-
const graphics = { ...target.graphics
|
|
875
|
+
const graphics = { ...target.graphics };
|
|
876
876
|
for (const [key2, value] of attrs) {
|
|
877
877
|
if ("x" in target && (key2 === "x" || key2 === "y" || key2 === "z")) {
|
|
878
878
|
if (target[key2] !== null && target[key2] !== void 0) {
|
|
@@ -943,7 +943,7 @@ class XgmmlParser {
|
|
|
943
943
|
if (target.graphics !== null && att.name in target.graphics) {
|
|
944
944
|
this.duplicateGraphics(att.name, att.line);
|
|
945
945
|
}
|
|
946
|
-
target.graphics = { ...target.graphics
|
|
946
|
+
target.graphics = { ...target.graphics, [att.name]: attJson(att) };
|
|
947
947
|
}
|
|
948
948
|
/**
|
|
949
949
|
* W_DUPLICATE_ATTRIBUTE for a graphics property given twice on one element (once per name).
|
|
@@ -2623,7 +2623,7 @@ class XgmmlEmitter {
|
|
|
2623
2623
|
this.graphColumns.addAtt(0, att, where);
|
|
2624
2624
|
}
|
|
2625
2625
|
this.graphColumns.write(this.sink, () => 0);
|
|
2626
|
-
const json = { ...this.extras.graphJson
|
|
2626
|
+
const json = { ...this.extras.graphJson };
|
|
2627
2627
|
if (g.graphics !== null && Object.keys(g.graphics).length > 0) {
|
|
2628
2628
|
json[GRAPHICS_COLUMN] = g.graphics;
|
|
2629
2629
|
}
|
|
@@ -2658,7 +2658,7 @@ class XgmmlEmitter {
|
|
|
2658
2658
|
directed: this.doc.root.attrs.get("directed") ?? null,
|
|
2659
2659
|
rdf: Object.keys(rdf).length > 0 ? { ...rdf } : null
|
|
2660
2660
|
},
|
|
2661
|
-
...this.extras.metaExtra
|
|
2661
|
+
...this.extras.metaExtra
|
|
2662
2662
|
}
|
|
2663
2663
|
});
|
|
2664
2664
|
}
|
|
@@ -3250,7 +3250,7 @@ function sniffXgmml(head) {
|
|
|
3250
3250
|
const root = /<(?![?!])([A-Za-z_][\w.-]*:)?([A-Za-z_][\w.-]*)[\s/>]/.exec(
|
|
3251
3251
|
text.replaceAll(/<!--[\s\S]*?(-->|$)/g, "")
|
|
3252
3252
|
);
|
|
3253
|
-
if (root
|
|
3253
|
+
if (root?.[2] !== "graph") {
|
|
3254
3254
|
return 0;
|
|
3255
3255
|
}
|
|
3256
3256
|
const tagEnd = text.indexOf(">", root.index);
|
|
@@ -3305,4 +3305,4 @@ export {
|
|
|
3305
3305
|
resolveSettings as r,
|
|
3306
3306
|
xgmmlImporter as x
|
|
3307
3307
|
};
|
|
3308
|
-
//# sourceMappingURL=importer-
|
|
3308
|
+
//# sourceMappingURL=importer-yWUPR_nU.js.map
|