@graphty/graphty-element 2.6.1 → 3.0.0
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/ai.js +3 -3
- package/dist/catalog.js +53 -54
- package/dist/chunks/{AiManager-4iQpsJW1.js → AiManager-Bhh0rR_p.js} +706 -655
- package/dist/chunks/GraphSession-DPoTaT3b.js +21175 -0
- package/dist/chunks/{GraphtyLogger-B_O67a6c.js → GraphtyLogger-BtcBJQPL.js} +1 -1
- package/dist/chunks/{VoiceInputAdapter-Cc6mHXTI.js → VoiceInputAdapter-CdLsJ_nG.js} +1 -1
- package/dist/chunks/{XRPivotCameraController-BLa89LXn.js → XRPivotCameraController-CiLJ9Gz6.js} +2 -2
- package/dist/chunks/algorithms-qij74zEN.js +6811 -0
- package/dist/chunks/{capability-check-Am2zliFj.js → capability-check-BbgTejS3.js} +1 -1
- package/dist/chunks/definePalette-BYt2Llxs.js +1333 -0
- package/dist/chunks/fields-5uVC1Pll.js +4999 -0
- package/dist/chunks/{format-detection-BHwrAVzW.js → format-detection-FKaDMshR.js} +1 -1
- package/dist/chunks/{index-BkBLbvui.js → index-Cc_6D9hV.js} +6034 -7127
- package/dist/chunks/interpolation-Dk206AhZ.js +105 -0
- package/dist/chunks/paletteRegistry-De3CGdst.js +357 -0
- package/dist/chunks/parse-SVp77JbE.js +669 -0
- package/dist/chunks/{pluginRegistry-Bs8bEkz9.js → pluginRegistry-Ddfl6Mv2.js} +27 -24
- package/dist/chunks/{registry-BdGvyZou.js → registry-CgMqldp4.js} +1 -1
- package/dist/chunks/{DataSource-BL2UzPff.js → sources-BbAJCDIH.js} +279 -108
- package/dist/commands.d.ts +128 -19
- package/dist/commands.js +49 -1
- package/dist/custom-elements.json +1 -1
- package/dist/extend.d.ts +10 -2
- package/dist/extend.js +64 -57
- package/dist/graphty-catalog.json +6 -3
- package/dist/graphty.bundle.js +267177 -240648
- package/dist/graphty.js +84 -78
- package/dist/index.d.ts +4 -0
- package/dist/logging.js +2 -2
- package/dist/schema.js +70 -71
- package/dist/session.d.ts +5 -6
- package/dist/session.js +40 -86
- package/dist/src/Edge.d.ts +31 -67
- package/dist/src/Graph.d.ts +335 -77
- package/dist/src/Node.d.ts +36 -3
- package/dist/src/NodeBehavior.d.ts +28 -0
- package/dist/src/Styles.d.ts +15 -4
- package/dist/src/acceleration/AccelerationController.d.ts +8 -0
- package/dist/src/acceleration/narrow.d.ts +9 -1
- package/dist/src/acceleration/types.d.ts +10 -0
- package/dist/src/ai/AiController.d.ts +12 -0
- package/dist/src/ai/AiManager.d.ts +7 -0
- package/dist/src/ai/commands/AlgorithmCommands.d.ts +1 -1
- package/dist/src/ai/commands/LayoutCommands.d.ts +1 -1
- package/dist/src/ai/commands/StyleCommands.d.ts +1 -1
- package/dist/src/ai/commands/types.d.ts +20 -1
- package/dist/src/algorithms/Algorithm.d.ts +21 -4
- package/dist/src/algorithms/BFSAlgorithm.d.ts +0 -9
- package/dist/src/algorithms/BellmanFordAlgorithm.d.ts +0 -14
- package/dist/src/algorithms/DFSAlgorithm.d.ts +1 -1
- package/dist/src/algorithms/FloydWarshallAlgorithm.d.ts +5 -0
- package/dist/src/algorithms/GirvanNewmanAlgorithm.d.ts +5 -0
- package/dist/src/algorithms/LeidenAlgorithm.d.ts +5 -0
- package/dist/src/algorithms/PageRankAlgorithm.d.ts +1 -1
- package/dist/src/algorithms/StronglyConnectedComponentsAlgorithm.d.ts +1 -1
- package/dist/src/algorithms/metrics/fields.d.ts +23 -1
- package/dist/src/algorithms/utils/graphUtils.d.ts +13 -1
- package/dist/src/catalog/paletteRegistry.d.ts +4 -4
- package/dist/src/catalog/registry.d.ts +3 -2
- package/dist/src/catalog/types.d.ts +18 -1
- package/dist/src/config/GraphStyle.d.ts +1 -1
- package/dist/src/config/StyleTemplate.d.ts +2 -2
- package/dist/src/config/xr-config-schema.d.ts +4 -4
- package/dist/src/data/CSVDataSource.d.ts +77 -22
- package/dist/src/data/ErrorAggregator.d.ts +5 -0
- package/dist/src/data/GEXFDataSource.d.ts +12 -61
- package/dist/src/data/GraphMLDataSource.d.ts +3 -44
- package/dist/src/data/GraphStore.d.ts +322 -15
- package/dist/src/data/JsonDataSource.d.ts +43 -1
- package/dist/src/data/graph-io-import.d.ts +89 -0
- package/dist/src/data/graph-io-records.d.ts +64 -0
- package/dist/src/data/lane.d.ts +23 -0
- package/dist/src/data/positions.d.ts +13 -0
- package/dist/src/data/seedPosition.d.ts +16 -0
- package/dist/src/errors/GraphtyError.d.ts +3 -1
- package/dist/src/errors/codes.d.ts +23 -0
- package/dist/src/events.d.ts +12 -0
- package/dist/src/graphty-element.d.ts +149 -54
- package/dist/src/input/types.d.ts +2 -0
- package/dist/src/layout/D3GraphLayoutEngine.d.ts +17 -3
- package/dist/src/layout/FixedLayoutEngine.d.ts +20 -4
- package/dist/src/layout/KamadaKawaiLayoutEngine.d.ts +6 -0
- package/dist/src/layout/LayoutEngine.d.ts +214 -116
- package/dist/src/layout/NGraphLayoutEngine.d.ts +10 -3
- package/dist/src/layout/SimulationLayoutEngine.d.ts +8 -3
- package/dist/src/managers/AlgorithmManager.d.ts +24 -5
- package/dist/src/managers/DataManager.d.ts +258 -181
- package/dist/src/managers/EventManager.d.ts +5 -2
- package/dist/src/managers/GraphContext.d.ts +7 -0
- package/dist/src/managers/InputManager.d.ts +11 -0
- package/dist/src/managers/LayoutManager.d.ts +129 -50
- package/dist/src/managers/RenderManager.d.ts +14 -1
- package/dist/src/managers/UpdateManager.d.ts +20 -0
- package/dist/src/screenshot/ScreenshotCapture.d.ts +1 -1
- package/dist/src/session/GraphSession.d.ts +83 -6
- package/dist/src/session/commands/algo.d.ts +169 -0
- package/dist/src/session/commands/config.d.ts +45 -0
- package/dist/src/session/commands/data.d.ts +178 -0
- package/dist/src/session/commands/doors.d.ts +93 -0
- package/dist/src/session/commands/index.d.ts +20 -0
- package/dist/src/session/commands/layout.d.ts +104 -0
- package/dist/src/session/commands/positions.d.ts +30 -0
- package/dist/src/session/commands/sets.d.ts +113 -0
- package/dist/src/session/commands/style.d.ts +92 -0
- package/dist/src/session/commands/view.d.ts +57 -0
- package/dist/src/session/commands/visibility.d.ts +41 -0
- package/dist/src/session/data.d.ts +131 -4
- package/dist/src/session/index.d.ts +1 -1
- package/dist/src/session/planning.d.ts +25 -8
- package/dist/src/session/project/Dispatcher.d.ts +905 -0
- package/dist/src/session/project/History.d.ts +382 -0
- package/dist/src/session/project/arrangement.d.ts +247 -0
- package/dist/src/session/project/derive.d.ts +132 -0
- package/dist/src/session/project/digest.d.ts +33 -0
- package/dist/src/session/project/draft.d.ts +194 -0
- package/dist/src/session/project/graphOps.d.ts +304 -0
- package/dist/src/session/project/ingest.d.ts +364 -0
- package/dist/src/session/project/state.d.ts +145 -0
- package/dist/src/session/project/strict.d.ts +68 -0
- package/dist/src/session/results/RunResult.d.ts +48 -0
- package/dist/src/session/results/statistics.d.ts +20 -0
- package/dist/src/session/runs/Run.d.ts +80 -4
- package/dist/src/session/runs/RunsApi.d.ts +23 -6
- package/dist/src/session/runs/types.d.ts +25 -6
- package/dist/src/session/scope/ElementMask.d.ts +14 -0
- package/dist/src/session/scope/ScopeApi.d.ts +3 -22
- package/dist/src/session/scope/spaces.d.ts +29 -0
- package/dist/src/session/sealed.d.ts +22 -0
- package/dist/src/session/selection/SelectionApi.d.ts +14 -4
- package/dist/src/session/sets/SetsApi.d.ts +13 -5
- package/dist/src/session/sets/store.d.ts +54 -53
- package/dist/src/session/sets/types.d.ts +5 -2
- package/dist/src/session/styles/Layer.d.ts +5 -0
- package/dist/src/session/styles/StylesApi.d.ts +68 -17
- package/dist/src/session/styles/autoApply.d.ts +64 -53
- package/dist/src/session/styles/index.d.ts +3 -3
- package/dist/src/session/styles/predicate.d.ts +7 -0
- package/dist/src/session/styles/repaint.d.ts +16 -1
- package/dist/src/session/styles/sources.d.ts +1 -1
- package/dist/src/session/types.d.ts +625 -54
- package/dist/src/session/visibility/VisibilityApi.d.ts +38 -18
- package/dist/src/session/visibility/filter.d.ts +10 -0
- package/dist/src/simple/defineAlgorithm.d.ts +28 -0
- package/dist/src/simple/defineLayout.d.ts +35 -0
- package/dist/src/simple/defineLogDestination.d.ts +31 -0
- package/dist/src/simple/definePalette.d.ts +26 -0
- package/dist/src/simple/definition.d.ts +106 -0
- package/dist/src/simple/options.d.ts +33 -0
- package/dist/src/simple/source.d.ts +49 -0
- package/dist/src/simple/types.d.ts +366 -0
- package/dist/src/simple/view.d.ts +107 -0
- package/dist/webgpu.js +2 -2
- package/package.json +10 -12
- package/dist/chunks/GraphSession-BhuHSXIo.js +0 -12819
- package/dist/chunks/GraphStyle-Cwr55SAE.js +0 -65
- package/dist/chunks/algorithms-BJ6DQMOe.js +0 -3777
- package/dist/chunks/detect-fyuVnlCT.js +0 -88
- package/dist/chunks/interpolation-DY-PNpqX.js +0 -43
- package/dist/chunks/optionsFromZod-CKMYSwTz.js +0 -3636
- package/dist/chunks/paletteRegistry-BCFSwJGK.js +0 -1196
- package/dist/chunks/parse-BMTqt4SS.js +0 -3658
- package/dist/src/data/csv-variant-detection.d.ts +0 -29
- package/dist/src/data/ingest.d.ts +0 -104
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
export type CSVVariant = "neo4j" | "gephi" | "cytoscape" | "adjacency-list" | "edge-list" | "node-list" | "generic";
|
|
2
|
-
export interface CSVVariantInfo {
|
|
3
|
-
variant: CSVVariant;
|
|
4
|
-
hasHeaders: boolean;
|
|
5
|
-
delimiter: string;
|
|
6
|
-
sourceColumn?: string;
|
|
7
|
-
targetColumn?: string;
|
|
8
|
-
idColumn?: string;
|
|
9
|
-
labelColumn?: string;
|
|
10
|
-
typeColumn?: string;
|
|
11
|
-
interactionColumn?: string;
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Work out a delimited file's column separator from its first line.
|
|
15
|
-
*
|
|
16
|
-
* Papaparse's own guess is not used because it guesses from the rows it previews, and the one-row
|
|
17
|
-
* preview that reads the header row sees too little to tell a tab from a comma: it answers "," and
|
|
18
|
-
* the header `source<TAB>target` comes back as one column.
|
|
19
|
-
* @param content - The file, or at least its first line.
|
|
20
|
-
* @returns Whichever of comma, tab, semicolon and pipe appears most often outside quotes on the
|
|
21
|
-
* first line, or a comma when none does.
|
|
22
|
-
*/
|
|
23
|
-
export declare function sniffDelimiter(content: string): string;
|
|
24
|
-
/**
|
|
25
|
-
* Detect CSV variant from headers and sample data
|
|
26
|
-
* @param headers - Array of column header names
|
|
27
|
-
* @returns Information about the detected CSV variant including column mappings
|
|
28
|
-
*/
|
|
29
|
-
export declare function detectCSVVariant(headers: string[]): CSVVariantInfo;
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import type { GraphStore } from "./GraphStore";
|
|
2
|
-
/**
|
|
3
|
-
* Whether a value may be used as a graph-format node id.
|
|
4
|
-
*
|
|
5
|
-
* graph-format accepts a string or a FINITE number and throws `E_INVALID_ID` for anything else
|
|
6
|
-
* (`graph-format/src/ids/node-id-map.ts`). The element is looser: a node id is whatever the
|
|
7
|
-
* configured JMESPath expression returns, which is `null` for a record that does not carry the
|
|
8
|
-
* key at all, and the element has always let such a record through and rendered it. So the id is
|
|
9
|
-
* CHECKED here rather than thrown on -- an unusable id leaves the render object exactly as it is
|
|
10
|
-
* today and keeps it out of the store, which is the one place the id has to be real.
|
|
11
|
-
* @param id - the extracted id
|
|
12
|
-
* @returns true when graph-format will accept it
|
|
13
|
-
*/
|
|
14
|
-
export declare function isStorableId(id: unknown): id is string | number;
|
|
15
|
-
/**
|
|
16
|
-
* Push one node record into the element's builder and seed its import position.
|
|
17
|
-
*
|
|
18
|
-
* The seed column keeps FILE units: `config.data.knownFields.positionScale` is applied by
|
|
19
|
-
* `GraphStore` on every freeze, so a scale changed after a record arrived still reaches the scene
|
|
20
|
-
* correctly from the same column.
|
|
21
|
-
* @param store - the element's store
|
|
22
|
-
* @param id - the node id, already extracted with JMESPath
|
|
23
|
-
* @param record - the raw record
|
|
24
|
-
* @returns the assigned node index -- `INVALID_INDEX` when the id is not one graph-format accepts
|
|
25
|
-
* -- and whether the builder already knew this id
|
|
26
|
-
*/
|
|
27
|
-
export declare function ingestNode(store: GraphStore, id: unknown, record: Record<string | number, unknown>): {
|
|
28
|
-
index: number;
|
|
29
|
-
merged: boolean;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Resolve an edge weight: the configured path, then the legacy "value" key, then 1.
|
|
33
|
-
*
|
|
34
|
-
* The second probe exists because the conversion this replaced hard-coded a `value` weight key, so
|
|
35
|
-
* every weighted dataset, fixture and story in this repository carries `value` and nothing carries
|
|
36
|
-
* `weight`. Reading only the configured path would silently re-read all of them as unweighted.
|
|
37
|
-
* The probe is removed once nothing ships a `value` key.
|
|
38
|
-
* @param record - the raw edge record
|
|
39
|
-
* @param path - `config.data.knownFields.edgeWeightPath`; null means "do not look"
|
|
40
|
-
* @returns the weight and which probe produced it
|
|
41
|
-
*/
|
|
42
|
-
export declare function resolveEdgeWeight(record: Record<string | number, unknown>, path: string | null): {
|
|
43
|
-
weight: number;
|
|
44
|
-
source: "path" | "legacy" | "default";
|
|
45
|
-
};
|
|
46
|
-
/**
|
|
47
|
-
* Push one edge into the element's builder and stamp its element-assigned counter column.
|
|
48
|
-
*
|
|
49
|
-
* The builder is constructed with `addMissingNodes: true`, so an endpoint that has not arrived yet
|
|
50
|
-
* is MATERIALISED here and the snapshot is complete while the render side is still catching up.
|
|
51
|
-
* That is deliberate: the snapshot is the authoritative copy, and it must not be missing an edge
|
|
52
|
-
* merely because a mesh has not been built for one of its endpoints.
|
|
53
|
-
*
|
|
54
|
-
* Note the argument order of `setEdgeValue`: `(column, edge, value)`. Swapping the first two is
|
|
55
|
-
* `E_UNKNOWN_COLUMN` at run time in plain JavaScript; the branded `ColumnHandle` type is what makes
|
|
56
|
-
* it a compile error here.
|
|
57
|
-
* @param store - the element's store
|
|
58
|
-
* @param srcId - source node id, already extracted with JMESPath
|
|
59
|
-
* @param dstId - destination node id
|
|
60
|
-
* @param weight - the resolved weight
|
|
61
|
-
* @param fileId - the edge's id read at the configured `edgeIdPath`, when there is one: its stable
|
|
62
|
-
* identity (design/sets/sets-design.md 12.3)
|
|
63
|
-
* @returns the logical edge index and the counter stamped into the edge's id column, or
|
|
64
|
-
* `INVALID_INDEX` for both when either id is not one graph-format accepts
|
|
65
|
-
*/
|
|
66
|
-
export declare function ingestEdge(store: GraphStore, srcId: unknown, dstId: unknown, weight: number, fileId?: string | number): {
|
|
67
|
-
index: number;
|
|
68
|
-
edgeId: number;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* What became of a file's declared direction when it reached the builder.
|
|
72
|
-
*
|
|
73
|
-
* - `applied`: the builder now holds the direction the file declared.
|
|
74
|
-
* - `unchanged`: the builder already held it, so there was nothing to do.
|
|
75
|
-
* - `config-wins`: `data.directed` was set explicitly, which locked the builder. The consumer
|
|
76
|
-
* settled the question and a file header does not overrule them.
|
|
77
|
-
* - `edges-present`: the builder already holds edges, which is a direction graph-format will not
|
|
78
|
-
* reinterpret in place. This is a second file loaded into a graph that the first file, or
|
|
79
|
-
* pushed records, already filled.
|
|
80
|
-
*/
|
|
81
|
-
export type DirectionOutcome = "applied" | "unchanged" | "config-wins" | "edges-present";
|
|
82
|
-
/**
|
|
83
|
-
* Give the builder the direction a file declared, without ever overruling the consumer.
|
|
84
|
-
*
|
|
85
|
-
* THE PRECEDENCE, highest first: an explicit `config.data.directed`, then the file's own header,
|
|
86
|
-
* then the builder's constructor value. `GraphStore` implements the first rung by calling
|
|
87
|
-
* `lockDirected()` for an explicit boolean and NOT calling it under `"auto"`, so
|
|
88
|
-
* `builder.directedLocked` is exactly "the consumer has settled this" and is the flag this reads.
|
|
89
|
-
* Locked is checked rather than caught, because `setDirected` on a locked builder whose value
|
|
90
|
-
* differs throws `E_DIRECTED` -- turning a consumer's perfectly legitimate `directed: false` plus
|
|
91
|
-
* a directed file into a failed import.
|
|
92
|
-
*
|
|
93
|
-
* A builder that already holds edges is refused for the same reason and not as a policy choice:
|
|
94
|
-
* graph-format accepts directed -> undirected only while the builder is empty, and accepts
|
|
95
|
-
* undirected -> directed with live edges only by MIRRORING every edge it holds, which would
|
|
96
|
-
* silently double the first file's edge count when a second file disagreed with it. So the first
|
|
97
|
-
* thing that settles the direction of a non-empty graph keeps it, and the caller is told.
|
|
98
|
-
* @param store - the element's store
|
|
99
|
-
* @param directed - the direction the file declared
|
|
100
|
-
* @param statedBy - the text in the file that declared it, recorded on the store so a consumer can
|
|
101
|
-
* be told not only what the graph is but what said so
|
|
102
|
-
* @returns what happened, for the caller to log
|
|
103
|
-
*/
|
|
104
|
-
export declare function ingestDeclaredDirection(store: GraphStore, directed: boolean, statedBy: string): DirectionOutcome;
|