@graphty/graph-io 0.3.18 → 0.3.20
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 +80 -2
- package/dist/chunks/{escape-D-gZWO26.js → escape-B-tkk_Cl.js} +74 -16
- package/dist/chunks/escape-B-tkk_Cl.js.map +1 -0
- package/dist/chunks/{writer-GAdltGmC.js → export-Bh60Dv-n.js} +7 -252
- package/dist/chunks/export-Bh60Dv-n.js.map +1 -0
- package/dist/chunks/exporter-BGrsWamJ.js +736 -0
- package/dist/chunks/exporter-BGrsWamJ.js.map +1 -0
- package/dist/chunks/exporter-DIeGJXAZ.js +834 -0
- package/dist/chunks/exporter-DIeGJXAZ.js.map +1 -0
- package/dist/chunks/{importer-Br_QeAeE.js → importer-BWY2FFc5.js} +28 -6
- package/dist/chunks/importer-BWY2FFc5.js.map +1 -0
- package/dist/chunks/importer-BaQpCEcJ.js +2194 -0
- package/dist/chunks/importer-BaQpCEcJ.js.map +1 -0
- package/dist/chunks/importer-DD-xv9_Y.js +1471 -0
- package/dist/chunks/importer-DD-xv9_Y.js.map +1 -0
- package/dist/chunks/{importer-aNJfe0qu.js → importer-DEcKhsmQ.js} +2 -2
- package/dist/chunks/{importer-aNJfe0qu.js.map → importer-DEcKhsmQ.js.map} +1 -1
- package/dist/chunks/{importer-DHagxvDD.js → importer-DIrbbnAf.js} +6 -4
- package/dist/chunks/{importer-DHagxvDD.js.map → importer-DIrbbnAf.js.map} +1 -1
- package/dist/chunks/importer-D_e7e7LX.js +3055 -0
- package/dist/chunks/importer-D_e7e7LX.js.map +1 -0
- package/dist/chunks/{importer-Du5crN9l.js → importer-Wv4C4gaF.js} +278 -82
- package/dist/chunks/importer-Wv4C4gaF.js.map +1 -0
- package/dist/chunks/importer-vi3bSdtw.js +1713 -0
- package/dist/chunks/importer-vi3bSdtw.js.map +1 -0
- package/dist/chunks/{importer-d0uQxFp6.js → importer-zGLo8Dg_.js} +6 -4
- package/dist/chunks/{importer-d0uQxFp6.js.map → importer-zGLo8Dg_.js.map} +1 -1
- package/dist/chunks/json-elements-DDS8N2Dd.js +779 -0
- package/dist/chunks/json-elements-DDS8N2Dd.js.map +1 -0
- package/dist/chunks/{records-Bk9jgodz.js → records-dbRkxwaq.js} +2 -2
- package/dist/chunks/{records-Bk9jgodz.js.map → records-dbRkxwaq.js.map} +1 -1
- package/dist/chunks/{report-BOk0p5y8.js → report-B1z4WT9e.js} +143 -111
- package/dist/chunks/{report-BOk0p5y8.js.map → report-B1z4WT9e.js.map} +1 -1
- package/dist/chunks/weights-Dzba96G3.js +176 -0
- package/dist/chunks/weights-Dzba96G3.js.map +1 -0
- package/dist/chunks/writer-C7flM-Ih.js +77 -0
- package/dist/chunks/writer-C7flM-Ih.js.map +1 -0
- package/dist/csv.js +6 -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/cys.d.ts +1 -0
- package/dist/cys.js +6 -0
- package/dist/cys.js.map +1 -0
- package/dist/dot.js +1 -1
- package/dist/gexf.js +16 -4
- package/dist/gexf.js.map +1 -1
- package/dist/gml.js +13 -14
- package/dist/gml.js.map +1 -1
- package/dist/graph-io.js +302 -399
- package/dist/graph-io.js.map +1 -1
- package/dist/graphml.js +1 -1
- package/dist/json.js +1 -1
- package/dist/neo4j.js +6 -4
- package/dist/neo4j.js.map +1 -1
- package/dist/obo.js +1 -1
- package/dist/pajek.js +1 -1
- package/dist/src/common/cell-budget.d.ts +84 -0
- package/dist/src/common/cell-budget.d.ts.map +1 -0
- package/dist/src/common/cell-budget.js +138 -0
- package/dist/src/common/cell-budget.js.map +1 -0
- package/dist/src/common/input.d.ts +10 -0
- package/dist/src/common/input.d.ts.map +1 -1
- package/dist/src/common/input.js +39 -0
- package/dist/src/common/input.js.map +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/common/options.d.ts +6 -0
- 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.d.ts +37 -3
- package/dist/src/common/xml.d.ts.map +1 -1
- package/dist/src/common/xml.js +86 -6
- package/dist/src/common/xml.js.map +1 -1
- package/dist/src/common/zip.d.ts +92 -0
- package/dist/src/common/zip.d.ts.map +1 -0
- package/dist/src/common/zip.js +399 -0
- package/dist/src/common/zip.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/cys/constants.d.ts +68 -0
- package/dist/src/formats/cys/constants.d.ts.map +1 -0
- package/dist/src/formats/cys/constants.js +76 -0
- package/dist/src/formats/cys/constants.js.map +1 -0
- package/dist/src/formats/cys/importer.d.ts +38 -0
- package/dist/src/formats/cys/importer.d.ts.map +1 -0
- package/dist/src/formats/cys/importer.js +830 -0
- package/dist/src/formats/cys/importer.js.map +1 -0
- package/dist/src/formats/cys/index.d.ts +7 -0
- package/dist/src/formats/cys/index.d.ts.map +1 -0
- package/dist/src/formats/cys/index.js +7 -0
- package/dist/src/formats/cys/index.js.map +1 -0
- package/dist/src/formats/cys/session.d.ts +132 -0
- package/dist/src/formats/cys/session.d.ts.map +1 -0
- package/dist/src/formats/cys/session.js +315 -0
- package/dist/src/formats/cys/session.js.map +1 -0
- package/dist/src/formats/cys/tables.d.ts +90 -0
- package/dist/src/formats/cys/tables.d.ts.map +1 -0
- package/dist/src/formats/cys/tables.js +293 -0
- package/dist/src/formats/cys/tables.js.map +1 -0
- package/dist/src/formats/dot/exporter.d.ts +2 -0
- package/dist/src/formats/dot/exporter.d.ts.map +1 -1
- package/dist/src/formats/dot/exporter.js +12 -0
- package/dist/src/formats/dot/exporter.js.map +1 -1
- package/dist/src/formats/dot/importer.js +6 -2
- package/dist/src/formats/dot/importer.js.map +1 -1
- 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 +0 -2
- package/dist/src/formats/gexf/importer.d.ts.map +1 -1
- package/dist/src/formats/gexf/importer.js +1 -3
- 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.d.ts +0 -8
- package/dist/src/formats/gml/exporter.d.ts.map +1 -1
- package/dist/src/formats/gml/exporter.js +8 -18
- 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/formats/xgmml/columns.d.ts +152 -0
- package/dist/src/formats/xgmml/columns.d.ts.map +1 -0
- package/dist/src/formats/xgmml/columns.js +593 -0
- package/dist/src/formats/xgmml/columns.js.map +1 -0
- package/dist/src/formats/xgmml/constants.d.ts +196 -0
- package/dist/src/formats/xgmml/constants.d.ts.map +1 -0
- package/dist/src/formats/xgmml/constants.js +197 -0
- package/dist/src/formats/xgmml/constants.js.map +1 -0
- package/dist/src/formats/xgmml/document.d.ts +361 -0
- package/dist/src/formats/xgmml/document.d.ts.map +1 -0
- package/dist/src/formats/xgmml/document.js +695 -0
- package/dist/src/formats/xgmml/document.js.map +1 -0
- package/dist/src/formats/xgmml/emit.d.ts +341 -0
- package/dist/src/formats/xgmml/emit.d.ts.map +1 -0
- package/dist/src/formats/xgmml/emit.js +1275 -0
- package/dist/src/formats/xgmml/emit.js.map +1 -0
- package/dist/src/formats/xgmml/exporter.d.ts +24 -0
- package/dist/src/formats/xgmml/exporter.d.ts.map +1 -0
- package/dist/src/formats/xgmml/exporter.js +999 -0
- package/dist/src/formats/xgmml/exporter.js.map +1 -0
- package/dist/src/formats/xgmml/importer.d.ts +58 -0
- package/dist/src/formats/xgmml/importer.d.ts.map +1 -0
- package/dist/src/formats/xgmml/importer.js +360 -0
- package/dist/src/formats/xgmml/importer.js.map +1 -0
- package/dist/src/formats/xgmml/index.d.ts +8 -0
- package/dist/src/formats/xgmml/index.d.ts.map +1 -0
- package/dist/src/formats/xgmml/index.js +8 -0
- package/dist/src/formats/xgmml/index.js.map +1 -0
- package/dist/src/formats/xgmml/values.d.ts +60 -0
- package/dist/src/formats/xgmml/values.d.ts.map +1 -0
- package/dist/src/formats/xgmml/values.js +148 -0
- package/dist/src/formats/xgmml/values.js.map +1 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +4 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/registry.d.ts +7 -0
- package/dist/src/registry.d.ts.map +1 -1
- package/dist/src/registry.js +30 -10
- 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 +4 -0
- package/dist/src/sniff.js.map +1 -1
- package/dist/xgmml.d.ts +1 -0
- package/dist/xgmml.js +9 -0
- package/dist/xgmml.js.map +1 -0
- package/package.json +25 -2
- package/src/common/cell-budget.ts +170 -0
- package/src/common/input.ts +40 -0
- package/src/common/json-elements.ts +1147 -0
- package/src/common/options.ts +1 -1
- package/src/common/xml.ts +127 -6
- package/src/common/zip.ts +472 -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/cys/constants.ts +99 -0
- package/src/formats/cys/importer.ts +1100 -0
- package/src/formats/cys/index.ts +7 -0
- package/src/formats/cys/session.ts +428 -0
- package/src/formats/cys/tables.ts +400 -0
- package/src/formats/dot/exporter.ts +17 -0
- package/src/formats/dot/importer.ts +6 -2
- package/src/formats/gexf/exporter.ts +11 -0
- package/src/formats/gexf/importer.ts +1 -2
- package/src/formats/gexf/index.ts +1 -1
- package/src/formats/gml/exporter.ts +8 -19
- package/src/formats/json/importer.ts +6 -105
- package/src/formats/xgmml/columns.ts +747 -0
- package/src/formats/xgmml/constants.ts +265 -0
- package/src/formats/xgmml/document.ts +975 -0
- package/src/formats/xgmml/emit.ts +1563 -0
- package/src/formats/xgmml/exporter.ts +1215 -0
- package/src/formats/xgmml/importer.ts +491 -0
- package/src/formats/xgmml/index.ts +8 -0
- package/src/formats/xgmml/values.ts +183 -0
- package/src/index.ts +19 -0
- package/src/registry.ts +46 -15
- package/src/sniff.ts +18 -1
- package/dist/chunks/escape-D-gZWO26.js.map +0 -1
- package/dist/chunks/importer-Br_QeAeE.js.map +0 -1
- package/dist/chunks/importer-Du5crN9l.js.map +0 -1
- package/dist/chunks/writer-GAdltGmC.js.map +0 -1
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* What the XGMML importer and exporter share: the namespaces, the format facts, the fixed column
|
|
3
|
+
* names, the `meta.extra` key, and the issue and loss code tables (design
|
|
4
|
+
* `design/graph-io/cytoscape-and-obo/design.md` section 1.1).
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
AMBIGUOUS_GRAPH_NAME_CODE,
|
|
9
|
+
BAD_VALUE_CODE,
|
|
10
|
+
COLUMN_RENAMED_CODE,
|
|
11
|
+
COLUMN_RENAMED_LOSS_CODE,
|
|
12
|
+
DANGLING_REFERENCE_CODE,
|
|
13
|
+
DIRECTION_FORCED_CODE,
|
|
14
|
+
DIRECTION_REFUSED_CODE,
|
|
15
|
+
DUPLICATE_ATTRIBUTE_CODE,
|
|
16
|
+
DUPLICATE_EDGE_ID_CODE,
|
|
17
|
+
DUPLICATE_NODE_CODE,
|
|
18
|
+
EMPTY_INPUT_CODE,
|
|
19
|
+
ENCODING_FALLBACK_CODE,
|
|
20
|
+
EQUATION_AS_TEXT_CODE,
|
|
21
|
+
GRAPH_NOT_FOUND_CODE,
|
|
22
|
+
ID_MERGED_CODE,
|
|
23
|
+
ID_TEXT_TYPE_CODE,
|
|
24
|
+
INVALID_ENCODING_CODE,
|
|
25
|
+
INVALID_UTF8_CODE,
|
|
26
|
+
MISSING_ENDPOINT_CODE,
|
|
27
|
+
MISSING_ID_CODE,
|
|
28
|
+
MIXED_DIRECTION_CODE,
|
|
29
|
+
MULTIPLE_GRAPHS_CODE,
|
|
30
|
+
MUTUAL_EXPANDED_CODE,
|
|
31
|
+
NO_GRAPH_CODE,
|
|
32
|
+
OPTION_IGNORED_CODE,
|
|
33
|
+
PARENT_CYCLE_CODE,
|
|
34
|
+
PARENTS_DROPPED_CODE,
|
|
35
|
+
PRECISION_CODE,
|
|
36
|
+
ROLE_ASSUMED_CODE,
|
|
37
|
+
ROLE_DROPPED_CODE,
|
|
38
|
+
ROLE_TAKEN_CODE,
|
|
39
|
+
SINK_OPTION_CODE,
|
|
40
|
+
STORAGE_CLASS_CODE,
|
|
41
|
+
STRAY_TEXT_CODE,
|
|
42
|
+
TEMPORAL_DROPPED_CODE,
|
|
43
|
+
TEMPORAL_TEXT_DROPPED_CODE,
|
|
44
|
+
UNKNOWN_ATTR_TYPE_CODE,
|
|
45
|
+
UNKNOWN_ELEMENT_CODE,
|
|
46
|
+
UNKNOWN_ENCODING_CODE,
|
|
47
|
+
UNKNOWN_PARENT_CODE,
|
|
48
|
+
WEIGHT_KEY_CLASH_CODE,
|
|
49
|
+
WIDENED_CODE,
|
|
50
|
+
XML_ILLEGAL_CHAR_CODE,
|
|
51
|
+
XML_SYNTAX_CODE,
|
|
52
|
+
} from "../../common/codes.js";
|
|
53
|
+
|
|
54
|
+
/** The format name. */
|
|
55
|
+
export const FORMAT = "xgmml";
|
|
56
|
+
|
|
57
|
+
/** File extensions (never `.gr`, which DIMACS owns). */
|
|
58
|
+
export const EXTENSIONS: readonly string[] = Object.freeze([".xgmml", ".xml"]);
|
|
59
|
+
|
|
60
|
+
/** MIME types: the draft's (appendix E) and Cytoscape's. */
|
|
61
|
+
export const MIME_TYPES: readonly string[] = Object.freeze(["application/xgmml", "text/xgmml", "text/xgmml+xml"]);
|
|
62
|
+
|
|
63
|
+
/** The XGMML namespace. */
|
|
64
|
+
export const XGMML_NAMESPACE = "http://www.cs.rpi.edu/XGMML";
|
|
65
|
+
|
|
66
|
+
/** Cytoscape's namespace, bound to the `cy` prefix. */
|
|
67
|
+
export const CY_NAMESPACE = "http://www.cytoscape.org";
|
|
68
|
+
|
|
69
|
+
/** The XLink namespace. */
|
|
70
|
+
export const XLINK_NAMESPACE = "http://www.w3.org/1999/xlink";
|
|
71
|
+
|
|
72
|
+
/** The `meta.extra` key the importer writes and the exporter reads. */
|
|
73
|
+
export const META_KEY = "xgmml";
|
|
74
|
+
|
|
75
|
+
/** The label column (role label) of node and edge `label` attributes. */
|
|
76
|
+
export const LABEL_COLUMN = "label";
|
|
77
|
+
|
|
78
|
+
/** The edge `id` column (role id, unique). */
|
|
79
|
+
export const EDGE_ID_COLUMN = "id";
|
|
80
|
+
|
|
81
|
+
/** The node position (f32 x3, role position, y up). */
|
|
82
|
+
export const POSITION_COLUMN = "position";
|
|
83
|
+
|
|
84
|
+
/** Cytoscape's stacking order (`NODE_Z_LOCATION`), kept out of the position. */
|
|
85
|
+
export const Z_COLUMN = "z";
|
|
86
|
+
|
|
87
|
+
/** The node, edge and graph json column of a `<graphics>` element's values as written. */
|
|
88
|
+
export const GRAPHICS_COLUMN = "graphics";
|
|
89
|
+
|
|
90
|
+
/** The containing group node (u32, role parent). */
|
|
91
|
+
export const PARENT_COLUMN = "parent";
|
|
92
|
+
|
|
93
|
+
/** Every containing group node of a node that is in several groups (list of u32, role parents). */
|
|
94
|
+
export const PARENTS_COLUMN = "parents";
|
|
95
|
+
|
|
96
|
+
/** The json node column of a group's nested graph id, label and atts. */
|
|
97
|
+
export const SUBGRAPH_COLUMN = "xgmml.subgraph";
|
|
98
|
+
|
|
99
|
+
/** The string node column naming the network a node's nested-network pointer points to. */
|
|
100
|
+
export const NESTED_NETWORK_COLUMN = "cytoscape.nestedNetwork";
|
|
101
|
+
|
|
102
|
+
/** The string node column of a nested-network pointer into another file (`file.xgmml#id`). */
|
|
103
|
+
export const NETWORK_POINTER_COLUMN = "xgmml.networkPointer";
|
|
104
|
+
|
|
105
|
+
/** The list node column of the root-level subgraphs a node belongs to, in a generic document. */
|
|
106
|
+
export const NETWORKS_COLUMN = "xgmml.networks";
|
|
107
|
+
|
|
108
|
+
/** The edge column of Cytoscape's interaction type. */
|
|
109
|
+
export const INTERACTION_COLUMN = "interaction";
|
|
110
|
+
|
|
111
|
+
/** The `origin.namespace` of the columns the importer derives from XGMML structure. */
|
|
112
|
+
export const XGMML_ORIGIN_NAMESPACE = "xgmml";
|
|
113
|
+
|
|
114
|
+
/** The `origin.namespace` of the columns that hold Cytoscape-only data (z, nested networks). */
|
|
115
|
+
export const CYTOSCAPE_ORIGIN_NAMESPACE = "cytoscape";
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The issue codes the XGMML importer records (design section 8.6), by name: the codes shared with
|
|
119
|
+
* the other importers (src/common/codes.ts) and the XGMML-specific ones. A key is the code without
|
|
120
|
+
* its severity and format prefixes.
|
|
121
|
+
*/
|
|
122
|
+
export const XGMML_ISSUE = Object.freeze({
|
|
123
|
+
/** Fatal: the input is not well-formed XML. */
|
|
124
|
+
XML_SYNTAX: XML_SYNTAX_CODE,
|
|
125
|
+
/** Fatal: the input is empty or whitespace only. */
|
|
126
|
+
EMPTY_INPUT: EMPTY_INPUT_CODE,
|
|
127
|
+
/** Fatal: the input holds invalid UTF-8. */
|
|
128
|
+
INVALID_UTF8: INVALID_UTF8_CODE,
|
|
129
|
+
/** Fatal: bytes invalid in the encoding a BOM, a declaration or the option chose. */
|
|
130
|
+
INVALID_ENCODING: INVALID_ENCODING_CODE,
|
|
131
|
+
/** Undeclared non-UTF-8 bytes were read as windows-1252. */
|
|
132
|
+
ENCODING_FALLBACK: ENCODING_FALLBACK_CODE,
|
|
133
|
+
/** A declared encoding the platform cannot decode was ignored. */
|
|
134
|
+
UNKNOWN_ENCODING: UNKNOWN_ENCODING_CODE,
|
|
135
|
+
/** Fatal: the root element is not `<graph>` (an XHTML page embedding one, a GraphML file). */
|
|
136
|
+
NO_GRAPH: NO_GRAPH_CODE,
|
|
137
|
+
/** Fatal: a session view document (`cy:view="1"`): view SUIDs and no topology. */
|
|
138
|
+
VIEW_DOCUMENT: "E_XGMML_VIEW_DOCUMENT",
|
|
139
|
+
/** A node with neither an id nor a label; it is skipped with its subtree. */
|
|
140
|
+
MISSING_ID: MISSING_ID_CODE,
|
|
141
|
+
/** A node without an id; its label is used as the id. */
|
|
142
|
+
ID_FROM_LABEL: "W_XGMML_ID_FROM_LABEL",
|
|
143
|
+
/** An edge without a source or a target that no label alias resolves. */
|
|
144
|
+
MISSING_ENDPOINT: MISSING_ENDPOINT_CODE,
|
|
145
|
+
/** An edge endpoint that names no node (addMissingNodes false); the edge is skipped. */
|
|
146
|
+
UNKNOWN_NODE: "E_UNKNOWN_NODE",
|
|
147
|
+
/** Endpoints resolved through Cytoscape's `"a (pp) b"` label aliases; interactions filled from labels. */
|
|
148
|
+
LABEL_ALIAS: "W_XGMML_LABEL_ALIAS",
|
|
149
|
+
/** A node id declared twice; the declarations are merged. */
|
|
150
|
+
DUPLICATE_NODE: DUPLICATE_NODE_CODE,
|
|
151
|
+
/** An edge id used twice; the second edge is skipped. */
|
|
152
|
+
DUPLICATE_EDGE_ID: DUPLICATE_EDGE_ID_CODE,
|
|
153
|
+
/** A meta-edge the 2.x writer repeats inside a group; the copy is dropped. */
|
|
154
|
+
GROUP_DUPLICATE_EDGE: "W_XGMML_GROUP_DUPLICATE_EDGE",
|
|
155
|
+
/** A `directed` or `cy:directed` value other than 0 / 1. */
|
|
156
|
+
BAD_DIRECTED: "W_XGMML_BAD_DIRECTED",
|
|
157
|
+
/** A `documentVersion` that does not parse; the dialect is chosen from the content. */
|
|
158
|
+
DOCUMENT_VERSION: "W_XGMML_DOCUMENT_VERSION",
|
|
159
|
+
/** A root `<graph>` with neither the XGMML namespace nor an XGMML DOCTYPE. */
|
|
160
|
+
NO_NAMESPACE: "W_XGMML_NO_NAMESPACE",
|
|
161
|
+
/** A malformed `<att>`: a list with a value, a scalar with child atts, an att with no name. */
|
|
162
|
+
BAD_ATT: "W_XGMML_BAD_ATT",
|
|
163
|
+
/** A bare `&` read as `&` under repairBareAmpersands. */
|
|
164
|
+
AMPERSAND_REPAIRED: "W_XGMML_AMPERSAND_REPAIRED",
|
|
165
|
+
/** Two surrogate character references joined under pairSurrogateReferences. */
|
|
166
|
+
SURROGATE_PAIRED: "W_XGMML_SURROGATE_PAIRED",
|
|
167
|
+
/** An empty list whose element type nothing states; a list of strings is assumed. */
|
|
168
|
+
EMPTY_LIST_TYPE: "W_XGMML_EMPTY_LIST_TYPE",
|
|
169
|
+
/** A record list, a list of lists, a 2.x map or foreign XML in an att, kept as json. */
|
|
170
|
+
RECORD_LIST: "W_XGMML_RECORD_LIST",
|
|
171
|
+
/** A pointer into another file (`file.xgmml#id`); kept as text. */
|
|
172
|
+
CROSS_FILE_REFERENCE: "W_XGMML_CROSS_FILE_REFERENCE",
|
|
173
|
+
/** A graph nested in an edge's att; there is no model for it. */
|
|
174
|
+
EDGE_NESTED_GRAPH: "W_XGMML_EDGE_NESTED_GRAPH",
|
|
175
|
+
/** Elements of a session network declared outside every registered subnetwork. */
|
|
176
|
+
ROOT_ONLY_ELEMENTS: "W_XGMML_ROOT_ONLY_ELEMENTS",
|
|
177
|
+
/** A value that does not parse as its declared type; the cell is unset. */
|
|
178
|
+
BAD_VALUE: BAD_VALUE_CODE,
|
|
179
|
+
/** A column widened because its values or declared types disagree. */
|
|
180
|
+
WIDENED: WIDENED_CODE,
|
|
181
|
+
/** A long or real beyond what a double holds exactly. */
|
|
182
|
+
PRECISION: PRECISION_CODE,
|
|
183
|
+
/** A reference (xlink:href, nested-network pointer) that names nothing. */
|
|
184
|
+
DANGLING_REFERENCE: DANGLING_REFERENCE_CODE,
|
|
185
|
+
/** The same attribute twice on one element; the later value wins. */
|
|
186
|
+
DUPLICATE_ATTRIBUTE: DUPLICATE_ATTRIBUTE_CODE,
|
|
187
|
+
/** A group membership naming no node. */
|
|
188
|
+
UNKNOWN_PARENT: UNKNOWN_PARENT_CODE,
|
|
189
|
+
/** A group membership that would close a parent cycle; that link is dropped. */
|
|
190
|
+
PARENT_CYCLE: PARENT_CYCLE_CODE,
|
|
191
|
+
/** A Cytoscape formula kept as its text. */
|
|
192
|
+
EQUATION_AS_TEXT: EQUATION_AS_TEXT_CODE,
|
|
193
|
+
/** An att type XGMML and Cytoscape do not define; kept as text. */
|
|
194
|
+
UNKNOWN_ATTR_TYPE: UNKNOWN_ATTR_TYPE_CODE,
|
|
195
|
+
/** An element XGMML does not define at that place; skipped with its subtree. */
|
|
196
|
+
UNKNOWN_ELEMENT: UNKNOWN_ELEMENT_CODE,
|
|
197
|
+
/** Character data where XGMML allows only elements, or inside an att. */
|
|
198
|
+
STRAY_TEXT: STRAY_TEXT_CODE,
|
|
199
|
+
/** A session network document holds several registered networks; one was read. */
|
|
200
|
+
MULTIPLE_GRAPHS: MULTIPLE_GRAPHS_CODE,
|
|
201
|
+
/** graphIndex / graphName names no network (fatal). */
|
|
202
|
+
GRAPH_NOT_FOUND: GRAPH_NOT_FOUND_CODE,
|
|
203
|
+
/** graphName names several networks (fatal). */
|
|
204
|
+
AMBIGUOUS_GRAPH_NAME: AMBIGUOUS_GRAPH_NAME_CODE,
|
|
205
|
+
/** A column renamed `<name>#<n>` because its name was taken. */
|
|
206
|
+
COLUMN_RENAMED: COLUMN_RENAMED_CODE,
|
|
207
|
+
/** A column declared without its role because the table already holds it. */
|
|
208
|
+
ROLE_TAKEN: ROLE_TAKEN_CODE,
|
|
209
|
+
/** Two id texts merged into one number under ids "number". */
|
|
210
|
+
ID_MERGED: ID_MERGED_CODE,
|
|
211
|
+
/** An option the format has no use for. */
|
|
212
|
+
OPTION_IGNORED: OPTION_IGNORED_CODE,
|
|
213
|
+
/** A builder-policy option the sink does not honour. */
|
|
214
|
+
SINK_OPTION: SINK_OPTION_CODE,
|
|
215
|
+
/** The sink refused the file's direction. */
|
|
216
|
+
DIRECTION_REFUSED: DIRECTION_REFUSED_CODE,
|
|
217
|
+
/** Edges forced to the policy's direction. */
|
|
218
|
+
DIRECTION_FORCED: DIRECTION_FORCED_CODE,
|
|
219
|
+
/** A mixed file under onMixedDirection "error" (fatal). */
|
|
220
|
+
MIXED_DIRECTION: MIXED_DIRECTION_CODE,
|
|
221
|
+
});
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* Loss note codes of the XGMML exporter (check()): the XGMML ones and the shared ones its notes
|
|
225
|
+
* can carry. The generic notes of `checkCapabilities()` (dtypes, components, temporal and visual
|
|
226
|
+
* roles, extension tables) are those of `LOSS`.
|
|
227
|
+
*/
|
|
228
|
+
export const XGMML_LOSS = Object.freeze({
|
|
229
|
+
/** A json or nested-list column written as a string att. */
|
|
230
|
+
JSON_AS_STRING: "W_XGMML_JSON_AS_STRING",
|
|
231
|
+
/** A dtype written as a wider Cytoscape type (f32 as Double, u32 above i32 as Long, u8 as Integer, dict as String). */
|
|
232
|
+
WIDENED_TYPE: "W_XGMML_WIDENED_TYPE",
|
|
233
|
+
/** A string holding a character XML 1.0 cannot carry; export() throws. */
|
|
234
|
+
XML_ILLEGAL_CHAR: XML_ILLEGAL_CHAR_CODE,
|
|
235
|
+
/** A temporal column written as plain numbers. */
|
|
236
|
+
TEMPORAL_DROPPED: TEMPORAL_DROPPED_CODE,
|
|
237
|
+
/** A temporal text companion written as a plain string att. */
|
|
238
|
+
TEMPORAL_TEXT_DROPPED: TEMPORAL_TEXT_DROPPED_CODE,
|
|
239
|
+
/** A role the format has no slot for, written as a plain att. */
|
|
240
|
+
ROLE_DROPPED: ROLE_DROPPED_CODE,
|
|
241
|
+
/** A parents column not written because the snapshot also has a parent column. */
|
|
242
|
+
PARENTS_DROPPED: PARENTS_DROPPED_CODE,
|
|
243
|
+
/** A mutual pair written as two directed edges. */
|
|
244
|
+
MUTUAL_EXPANDED: MUTUAL_EXPANDED_CODE,
|
|
245
|
+
/** Node ids whose text reads back as the other type. */
|
|
246
|
+
ID_TEXT_TYPE: ID_TEXT_TYPE_CODE,
|
|
247
|
+
/** An edge id column of another dtype written as text; it reads back as strings. */
|
|
248
|
+
EDGE_ID_TEXT: "W_XGMML_EDGE_ID_TEXT",
|
|
249
|
+
/** Strings holding a literal backslash-n or backslash-t read back as newline / tab (Cytoscape's escapes). */
|
|
250
|
+
BACKSLASH_ESCAPE: "W_XGMML_BACKSLASH_ESCAPE",
|
|
251
|
+
/** A position that cannot be written as it is: another shape, a non-finite coordinate, a z read back in the z column. */
|
|
252
|
+
POSITION: "W_XGMML_POSITION",
|
|
253
|
+
/** Nodes whose parent chain never reaches a root are written at the top level. */
|
|
254
|
+
PARENT_CYCLE: "W_XGMML_PARENT_CYCLE",
|
|
255
|
+
/** A column named like a column the importer owns reads back renamed. */
|
|
256
|
+
COLUMN_NAME_CHANGED: COLUMN_RENAMED_LOSS_CODE,
|
|
257
|
+
/** A role-less column written into a slot reads back with the slot's role. */
|
|
258
|
+
ROLE_ASSUMED: ROLE_ASSUMED_CODE,
|
|
259
|
+
/** A plain `weight` edge column reads back as THE weight. */
|
|
260
|
+
WEIGHT_KEY_CLASH: WEIGHT_KEY_CLASH_CODE,
|
|
261
|
+
/** A string / dict column that reads back as the other storage class. */
|
|
262
|
+
STORAGE_CLASS_CHANGED: STORAGE_CLASS_CODE,
|
|
263
|
+
/** Edge labels shaped `a (i) b` read back with an `interaction` column (Cytoscape's label alias). */
|
|
264
|
+
INTERACTION_FROM_LABEL: "W_XGMML_INTERACTION_FROM_LABEL",
|
|
265
|
+
});
|