@graphty/graph-io 0.3.18 → 0.3.19
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 +37 -2
- package/dist/chunks/{escape-D-gZWO26.js → escape-CWExcecC.js} +3 -3
- package/dist/chunks/{escape-D-gZWO26.js.map → escape-CWExcecC.js.map} +1 -1
- package/dist/chunks/exporter-CbMZyVt-.js +735 -0
- package/dist/chunks/exporter-CbMZyVt-.js.map +1 -0
- package/dist/chunks/importer-BAP4PrxR.js +2194 -0
- package/dist/chunks/importer-BAP4PrxR.js.map +1 -0
- package/dist/chunks/{importer-Br_QeAeE.js → importer-BNFuV1-K.js} +5 -4
- package/dist/chunks/{importer-Br_QeAeE.js.map → importer-BNFuV1-K.js.map} +1 -1
- package/dist/chunks/{importer-d0uQxFp6.js → importer-BVGtU1NA.js} +5 -4
- package/dist/chunks/{importer-d0uQxFp6.js.map → importer-BVGtU1NA.js.map} +1 -1
- package/dist/chunks/{importer-DHagxvDD.js → importer-BW-Ft2ps.js} +5 -4
- package/dist/chunks/{importer-DHagxvDD.js.map → importer-BW-Ft2ps.js.map} +1 -1
- package/dist/chunks/{importer-Du5crN9l.js → importer-Bm1_5vPS.js} +275 -82
- package/dist/chunks/importer-Bm1_5vPS.js.map +1 -0
- package/dist/chunks/{importer-aNJfe0qu.js → importer-ByPGO-09.js} +2 -2
- package/dist/chunks/{importer-aNJfe0qu.js.map → importer-ByPGO-09.js.map} +1 -1
- package/dist/chunks/importer-DOepkgnG.js +1713 -0
- package/dist/chunks/importer-DOepkgnG.js.map +1 -0
- package/dist/chunks/json-elements-CZY1wiZh.js +779 -0
- package/dist/chunks/json-elements-CZY1wiZh.js.map +1 -0
- package/dist/chunks/{records-Bk9jgodz.js → records-BzNicMsf.js} +2 -2
- package/dist/chunks/{records-Bk9jgodz.js.map → records-BzNicMsf.js.map} +1 -1
- package/dist/chunks/{report-BOk0p5y8.js → report-BcWboivV.js} +95 -95
- package/dist/chunks/{report-BOk0p5y8.js.map → report-BcWboivV.js.map} +1 -1
- package/dist/chunks/weights-CwISIpCP.js +176 -0
- package/dist/chunks/weights-CwISIpCP.js.map +1 -0
- package/dist/chunks/{writer-GAdltGmC.js → writer-DQiKgQJc.js} +8 -179
- package/dist/chunks/writer-DQiKgQJc.js.map +1 -0
- package/dist/csv.js +5 -4
- package/dist/csv.js.map +1 -1
- package/dist/cx.d.ts +1 -0
- package/dist/cx.js +6 -0
- package/dist/cx.js.map +1 -0
- package/dist/cx2.d.ts +1 -0
- package/dist/cx2.js +10 -0
- package/dist/cx2.js.map +1 -0
- package/dist/dot.js +1 -1
- package/dist/gexf.js +15 -4
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +5 -4
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +145 -389
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +1 -1
- package/dist/json.js +1 -1
- package/dist/neo4j.js +5 -4
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +1 -1
- package/dist/src/common/json-elements.d.ts +286 -0
- package/dist/src/common/json-elements.d.ts.map +1 -0
- package/dist/src/common/json-elements.js +926 -0
- package/dist/src/common/json-elements.js.map +1 -0
- package/dist/src/formats/cx/importer.d.ts +133 -0
- package/dist/src/formats/cx/importer.d.ts.map +1 -0
- package/dist/src/formats/cx/importer.js +2220 -0
- package/dist/src/formats/cx/importer.js.map +1 -0
- package/dist/src/formats/cx/index.d.ts +7 -0
- package/dist/src/formats/cx/index.d.ts.map +1 -0
- package/dist/src/formats/cx/index.js +7 -0
- package/dist/src/formats/cx/index.js.map +1 -0
- package/dist/src/formats/cx2/exporter.d.ts +59 -0
- package/dist/src/formats/cx2/exporter.d.ts.map +1 -0
- package/dist/src/formats/cx2/exporter.js +864 -0
- package/dist/src/formats/cx2/exporter.js.map +1 -0
- package/dist/src/formats/cx2/importer.d.ts +169 -0
- package/dist/src/formats/cx2/importer.d.ts.map +1 -0
- package/dist/src/formats/cx2/importer.js +1652 -0
- package/dist/src/formats/cx2/importer.js.map +1 -0
- package/dist/src/formats/cx2/index.d.ts +7 -0
- package/dist/src/formats/cx2/index.d.ts.map +1 -0
- package/dist/src/formats/cx2/index.js +7 -0
- package/dist/src/formats/cx2/index.js.map +1 -0
- package/dist/src/formats/gexf/exporter.d.ts +2 -0
- package/dist/src/formats/gexf/exporter.d.ts.map +1 -1
- package/dist/src/formats/gexf/exporter.js +6 -0
- package/dist/src/formats/gexf/exporter.js.map +1 -1
- package/dist/src/formats/gexf/importer.d.ts +2 -4
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +2 -4
- package/dist/src/formats/gexf/importer.js.map +1 -1
- package/dist/src/formats/gexf/index.d.ts +1 -1
- package/dist/src/formats/gexf/index.js +2 -2
- package/dist/src/formats/gexf/index.js.map +1 -1
- package/dist/src/formats/gml/exporter.js +1 -1
- package/dist/src/formats/gml/exporter.js.map +1 -1
- package/dist/src/formats/json/importer.d.ts.map +1 -1
- package/dist/src/formats/json/importer.js +6 -104
- package/dist/src/formats/json/importer.js.map +1 -1
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +2 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +5 -0
- package/dist/src/registry.js.map +1 -1
- package/dist/src/sniff.d.ts +1 -1
- package/dist/src/sniff.d.ts.map +1 -1
- package/dist/src/sniff.js +2 -0
- package/dist/src/sniff.js.map +1 -1
- package/package.json +11 -1
- package/src/common/json-elements.ts +1147 -0
- package/src/formats/cx/importer.ts +2733 -0
- package/src/formats/cx/index.ts +7 -0
- package/src/formats/cx2/exporter.ts +1036 -0
- package/src/formats/cx2/importer.ts +2187 -0
- package/src/formats/cx2/index.ts +7 -0
- package/src/formats/gexf/exporter.ts +11 -0
- package/src/formats/gexf/importer.ts +2 -2
- package/src/formats/gexf/index.ts +1 -1
- package/src/formats/gml/exporter.ts +1 -1
- package/src/formats/json/importer.ts +6 -105
- package/src/index.ts +10 -0
- package/src/registry.ts +5 -0
- package/src/sniff.ts +14 -1
- package/dist/chunks/importer-Du5crN9l.js.map +0 -1
- package/dist/chunks/writer-GAdltGmC.js.map +0 -1
package/dist/cx.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/formats/cx/index.js";
|
package/dist/cx.js
ADDED
package/dist/cx.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cx.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/cx2.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./src/formats/cx2/index.js";
|
package/dist/cx2.js
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { C, a, c } from "./chunks/exporter-CbMZyVt-.js";
|
|
2
|
+
import { C as C2, c as c2 } from "./chunks/importer-DOepkgnG.js";
|
|
3
|
+
export {
|
|
4
|
+
C as CX2_CAPABILITIES,
|
|
5
|
+
C2 as CX2_ISSUE,
|
|
6
|
+
a as CX2_LOSS,
|
|
7
|
+
c as cx2Exporter,
|
|
8
|
+
c2 as cx2Importer
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=cx2.js.map
|
package/dist/cx2.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cx2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
|
package/dist/dot.js
CHANGED
package/dist/gexf.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { aG as TIME_TEXT_ROLE, aH as TIME_TEXT_SUFFIX, aC as resolveImportOptions, I as ImportReportBuilder, az as reportSinkOptions, aA as reportUnusedOptions, aD as textChunks, al as XML_SYNTAX_CODE, t as throwIfAborted, F as IdCoercer, p as DirectionResolver, a6 as STRAY_TEXT_CODE, S as NO_GRAPH_CODE, f as COUNT_HINT_CODE, l as DUPLICATE_ATTRIBUTE_CODE, aI as declareAttribute, ar as declareResolved, K as MISSING_ID_CODE, o as DUPLICATE_NODE_CODE, ag as UNKNOWN_PARENT_CODE, M as MISSING_ENDPOINT_CODE, m as DUPLICATE_EDGE_ID_CODE, aJ as parseDeclaredTemporal, aq as declareCompanion, aK as parseDeclaredValue, aL as losesPrecision, Z as PRECISION_CODE, aM as parseTimeText, aN as splitListText, ae as UNKNOWN_ELEMENT_CODE, u as ID_MERGED_CODE, aO as timeTextCompanion, aF as parseDecimalText, ax as pairFolding, aB as resolveExportOptions, aP as formatTimeValue, aQ as mapDeclaredType, aR as joinListText, aS as formatTemporal, av as isCanonicalIntegerText, N as MIXED_DIRECTION_CODE, j as DIRECTION_FORCED_CODE, k as DIRECTION_REFUSED_CODE, a2 as SINK_OPTION_CODE, U as OPTION_IGNORED_CODE, a1 as ROLE_TAKEN_CODE, C as COLUMN_RENAMED_CODE, c as BAD_OPTIONS_CODE, b as BAD_DEFAULT_CODE, ad as UNKNOWN_ATTR_TYPE_CODE, af as UNKNOWN_ENCODING_CODE, r as ENCODING_FALLBACK_CODE, y as INVALID_ENCODING_CODE, z as INVALID_UTF8_CODE } from "./chunks/report-BcWboivV.js";
|
|
2
2
|
import { GraphFormatError, INVALID_INDEX, MAX_COUNT } from "@graphty/graph-format";
|
|
3
|
-
import {
|
|
4
|
-
import { t as tokenizeXml, d as xmlDeclaredEncoding, X as XmlSyntaxError, l as localName, e as isWhitespace, x as xmlIllegalTextNotes, f as escapeXmlText, g as escapeXmlAttribute } from "./chunks/escape-
|
|
3
|
+
import { i as isWeightField, p as parseWeightText, e as explicitWeights, a as formatF32, b as formatF64, d as formatInteger } from "./chunks/weights-CwISIpCP.js";
|
|
4
|
+
import { t as tokenizeXml, d as xmlDeclaredEncoding, X as XmlSyntaxError, l as localName, e as isWhitespace, x as xmlIllegalTextNotes, f as escapeXmlText, g as escapeXmlAttribute } from "./chunks/escape-CWExcecC.js";
|
|
5
|
+
import { c as capabilities, L as LOSS, j as joinText, e as encodeChunks, s as sanitizeIds, a as checkCapabilities } from "./chunks/writer-DQiKgQJc.js";
|
|
5
6
|
const GEXF_FORMAT = "gexf";
|
|
6
7
|
const GEXF_NAMESPACES = {
|
|
7
8
|
"1.2": { gexf: "http://www.gexf.net/1.2draft", viz: "http://www.gexf.net/1.2draft/viz" },
|
|
@@ -275,7 +276,6 @@ const EDGE_TYPE_CODE = "E_GEXF_EDGE_TYPE";
|
|
|
275
276
|
const ATTRIBUTES_CLASS_CODE = "E_GEXF_ATTRIBUTES_CLASS";
|
|
276
277
|
const ATTRIBUTE_ID_CODE = "E_GEXF_ATTRIBUTE_ID";
|
|
277
278
|
const HEADER_VALUE_CODE = "W_GEXF_HEADER_VALUE";
|
|
278
|
-
const DUPLICATE_ATTRIBUTE_CODE = "W_GEXF_DUPLICATE_ATTRIBUTE";
|
|
279
279
|
const ATTRIBUTE_TYPE_CODE = "W_GEXF_ATTRIBUTE_TYPE";
|
|
280
280
|
const UNKNOWN_ATTRIBUTE_CODE = "W_GEXF_UNKNOWN_ATTRIBUTE";
|
|
281
281
|
const ATTVALUE_SHAPE_CODE = "W_GEXF_ATTVALUE_SHAPE";
|
|
@@ -2219,6 +2219,8 @@ const GEXF_LOSS = Object.freeze({
|
|
|
2219
2219
|
DECLARED_TYPE: "W_DECLARED_TYPE",
|
|
2220
2220
|
/** A node id whose text reads back as the other type under the canonical rule (design section 4.1): a non-integer number, a string of integer text. */
|
|
2221
2221
|
ID_TEXT_TYPE: LOSS.ID_TEXT_TYPE,
|
|
2222
|
+
/** A numeric edge id column: GEXF edge ids read back as strings. */
|
|
2223
|
+
EDGE_ID_TEXT: "W_GEXF_EDGE_ID_TEXT",
|
|
2222
2224
|
/** A viz role column (position, color, size, thickness) that is not f32; the importer reads viz values as f32. */
|
|
2223
2225
|
VIZ_DTYPE: "W_GEXF_VIZ_DTYPE",
|
|
2224
2226
|
/** A plain `weight` edge column reads back as THE weight (the importer's weightFrom default). */
|
|
@@ -2303,6 +2305,15 @@ function planExport(snapshot, options) {
|
|
|
2303
2305
|
typeChanges
|
|
2304
2306
|
);
|
|
2305
2307
|
}
|
|
2308
|
+
const edgeIds = snapshot.edges.byRole("id");
|
|
2309
|
+
if (edgeIds !== null && edgeIds.dtype !== "string" && edgeIds.dtype !== "dict") {
|
|
2310
|
+
note(
|
|
2311
|
+
GEXF_LOSS.EDGE_ID_TEXT,
|
|
2312
|
+
`edge id column "${edgeIds.meta.name}" is ${edgeIds.dtype}; GEXF edge ids read back as strings`,
|
|
2313
|
+
edgeIds.meta.name,
|
|
2314
|
+
snapshot.edgeCount - edgeIds.nullCount
|
|
2315
|
+
);
|
|
2316
|
+
}
|
|
2306
2317
|
const tables = collectTemporalTables(snapshot, version, note);
|
|
2307
2318
|
const nodeRoles = collectRoles(snapshot.nodes, "node", note);
|
|
2308
2319
|
const edgeRoles = collectRoles(snapshot.edges, "edge", note);
|