@ltm-blueverse/alpha-semantic-hub 0.7.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/LICENSE +21 -0
- package/README.md +1674 -0
- package/explorer/README.md +282 -0
- package/explorer/src/App.css +0 -0
- package/explorer/src/App.tsx +2035 -0
- package/explorer/src/ErrorBoundary.tsx +112 -0
- package/explorer/src/ExploreWorkspaceTabs.tsx +29 -0
- package/explorer/src/assets/hero.png +0 -0
- package/explorer/src/assets/react.svg +1 -0
- package/explorer/src/assets/vite.svg +1 -0
- package/explorer/src/explorerCapabilities.ts +24 -0
- package/explorer/src/index.css +71 -0
- package/explorer/src/main.tsx +7 -0
- package/explorer/src/store/edgePairKeys.d.ts +2 -0
- package/explorer/src/store/edgePairKeys.js +7 -0
- package/explorer/src/store/graphStore.ts +183 -0
- package/explorer/src/store/registryStore.ts +78 -0
- package/explorer/src/types.d.ts +16 -0
- package/explorer/src/ui/primitives.css +414 -0
- package/explorer/src/ui/primitives.tsx +170 -0
- package/explorer/src/workspaces/DecisionWorkspace/DecisionWorkspace.tsx +279 -0
- package/explorer/src/workspaces/DiffMergeWorkspace/DiffMergeWorkspace.tsx +121 -0
- package/explorer/src/workspaces/EnrichWorkspace/EntityResolutionTab.tsx +454 -0
- package/explorer/src/workspaces/EnrichWorkspace/RegistryTab.tsx +285 -0
- package/explorer/src/workspaces/GraphWorkspace/GraphCanvas.tsx +2673 -0
- package/explorer/src/workspaces/GraphWorkspace/GraphInspectorPanel.tsx +771 -0
- package/explorer/src/workspaces/GraphWorkspace/GraphLoadingOverlay.tsx +410 -0
- package/explorer/src/workspaces/GraphWorkspace/GraphWorkspace.tsx +3584 -0
- package/explorer/src/workspaces/GraphWorkspace/MarkdownContentViewer.tsx +705 -0
- package/explorer/src/workspaces/GraphWorkspace/SigmaSceneAdapter.tsx +55 -0
- package/explorer/src/workspaces/GraphWorkspace/TimelinePanel.tsx +193 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/clickSelectionBehavior.ts +29 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/fitViewBehavior.ts +15 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/focusCameraBehavior.ts +25 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/hoverActivationBehavior.ts +15 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/pathHighlightBehavior.ts +52 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/searchFocusBehavior.ts +36 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/types.ts +41 -0
- package/explorer/src/workspaces/GraphWorkspace/behaviors/viewModeSwitchBehavior.ts +29 -0
- package/explorer/src/workspaces/GraphWorkspace/graphAnalytics.ts +779 -0
- package/explorer/src/workspaces/GraphWorkspace/graphColorLegend.ts +36 -0
- package/explorer/src/workspaces/GraphWorkspace/graphConfig.ts +102 -0
- package/explorer/src/workspaces/GraphWorkspace/graphEntityShape.ts +34 -0
- package/explorer/src/workspaces/GraphWorkspace/graphLoading.ts +84 -0
- package/explorer/src/workspaces/GraphWorkspace/graphSceneLayers.ts +775 -0
- package/explorer/src/workspaces/GraphWorkspace/graphSceneState.ts +2753 -0
- package/explorer/src/workspaces/GraphWorkspace/graphStructureLayer.ts +335 -0
- package/explorer/src/workspaces/GraphWorkspace/graphTheme.ts +1078 -0
- package/explorer/src/workspaces/GraphWorkspace/graphViewCopy.ts +41 -0
- package/explorer/src/workspaces/GraphWorkspace/localGraphTransition.ts +9 -0
- package/explorer/src/workspaces/GraphWorkspace/markdownEditorState.ts +114 -0
- package/explorer/src/workspaces/GraphWorkspace/markdownResourceClient.ts +103 -0
- package/explorer/src/workspaces/GraphWorkspace/markdownUrlSafety.ts +29 -0
- package/explorer/src/workspaces/GraphWorkspace/nodeMarkdownSync.ts +81 -0
- package/explorer/src/workspaces/GraphWorkspace/pluginRegistryPredicates.ts +24 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/explorationEffectsPlugin.tsx +353 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/explorationEffectsPluginPhaseC.tsx +522 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/index.ts +16 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/legendPlugin.tsx +120 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/neighborhoodPanelPlugin.tsx +231 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/temporalOverlayPlugin.tsx +142 -0
- package/explorer/src/workspaces/GraphWorkspace/plugins/types.ts +106 -0
- package/explorer/src/workspaces/GraphWorkspace/realtimeGraphAttributes.ts +50 -0
- package/explorer/src/workspaces/GraphWorkspace/scene.ts +79 -0
- package/explorer/src/workspaces/GraphWorkspace/sigmaNativeRendering.ts +421 -0
- package/explorer/src/workspaces/GraphWorkspace/smallGraphLayout.ts +135 -0
- package/explorer/src/workspaces/GraphWorkspace/temporalLifecyclePredicates.ts +31 -0
- package/explorer/src/workspaces/GraphWorkspace/temporalScrubberBounds.ts +46 -0
- package/explorer/src/workspaces/GraphWorkspace/temporalSnapshotGuards.ts +113 -0
- package/explorer/src/workspaces/GraphWorkspace/types.ts +395 -0
- package/explorer/src/workspaces/GraphWorkspace/useLoadGraph.ts +746 -0
- package/explorer/src/workspaces/GraphWorkspace/useMarkdownEditor.ts +177 -0
- package/explorer/src/workspaces/ImportExportWorkspace/ImportExportWorkspace.tsx +196 -0
- package/explorer/src/workspaces/LineageWorkspace/LineageDiagram.tsx +177 -0
- package/explorer/src/workspaces/ManageWorkspace/KGOverviewTab.tsx +291 -0
- package/explorer/src/workspaces/ManageWorkspace/OntologySummaryTab.tsx +346 -0
- package/explorer/src/workspaces/MemoryWorkspace.tsx +464 -0
- package/explorer/src/workspaces/OntologyWorkspace/AlignmentsTab.tsx +437 -0
- package/explorer/src/workspaces/OntologyWorkspace/HealthTab.tsx +214 -0
- package/explorer/src/workspaces/OntologyWorkspace/OntologyEditor.tsx +770 -0
- package/explorer/src/workspaces/OntologyWorkspace/OntologyLoader.tsx +913 -0
- package/explorer/src/workspaces/OntologyWorkspace/OntologyManager.tsx +930 -0
- package/explorer/src/workspaces/OntologyWorkspace/OntologySearch.tsx +590 -0
- package/explorer/src/workspaces/OntologyWorkspace/ProposalReview.tsx +429 -0
- package/explorer/src/workspaces/OntologyWorkspace/SKOSVocabularyManager.tsx +696 -0
- package/explorer/src/workspaces/OntologyWorkspace/ShaclStudio.tsx +363 -0
- package/explorer/src/workspaces/OntologyWorkspace/VersionsTab.tsx +546 -0
- package/explorer/src/workspaces/OntologyWorkspace/api.ts +164 -0
- package/explorer/src/workspaces/OntologyWorkspace/index.tsx +101 -0
- package/explorer/src/workspaces/OntologyWorkspace/ontologyEditorModel.ts +87 -0
- package/explorer/src/workspaces/OntologyWorkspace/ontologyUrlState.ts +94 -0
- package/explorer/src/workspaces/OntologyWorkspace/types.ts +119 -0
- package/explorer/src/workspaces/ReasoningWorkspace.tsx +243 -0
- package/explorer/src/workspaces/SparqlWorkspace/SparqlWorkspace.tsx +271 -0
- package/explorer/src/workspaces/VocabularyWorkspace/ConceptTree.tsx +97 -0
- package/explorer/src/workspaces/VocabularyWorkspace/ImportDropzone.tsx +95 -0
- package/explorer/src/workspaces/VocabularyWorkspace/PropertyPanel.tsx +116 -0
- package/explorer/src/workspaces/VocabularyWorkspace/Sidebar.tsx +112 -0
- package/explorer/src/workspaces/VocabularyWorkspace/VocabularyWorkspace.tsx +70 -0
- package/explorer/src/workspaces/VocabularyWorkspace/queries.ts +52 -0
- package/explorer/src/workspaces/VocabularyWorkspace/types.ts +24 -0
- package/package.json +31 -0
- package/plugins/.claude-plugin/README.md +262 -0
- package/plugins/.claude-plugin/marketplace.json +20 -0
- package/plugins/.claude-plugin/plugin.json +33 -0
- package/plugins/.cline-plugin/README.md +32 -0
- package/plugins/.cline-plugin/marketplace.json +17 -0
- package/plugins/.cline-plugin/plugin.json +35 -0
- package/plugins/.codex-plugin/marketplace.json +21 -0
- package/plugins/.codex-plugin/plugin.json +35 -0
- package/plugins/.continue-plugin/README.md +34 -0
- package/plugins/.continue-plugin/marketplace.json +17 -0
- package/plugins/.continue-plugin/plugin.json +33 -0
- package/plugins/.cursor-plugin/marketplace.json +18 -0
- package/plugins/.cursor-plugin/plugin.json +32 -0
- package/plugins/.openclaw-plugin/README.md +62 -0
- package/plugins/.openclaw-plugin/marketplace.json +18 -0
- package/plugins/.openclaw-plugin/plugin.json +46 -0
- package/plugins/.pi-plugin/README.md +35 -0
- package/plugins/.vscode-plugin/README.md +48 -0
- package/plugins/.vscode-plugin/marketplace.json +17 -0
- package/plugins/.vscode-plugin/plugin.json +35 -0
- package/plugins/.windsurf-plugin/README.md +39 -0
- package/plugins/.windsurf-plugin/marketplace.json +17 -0
- package/plugins/.windsurf-plugin/plugin.json +35 -0
- package/plugins/agents/decision-advisor.md +126 -0
- package/plugins/agents/explainability.md +129 -0
- package/plugins/agents/kg-assistant.md +73 -0
- package/plugins/hooks/hooks.json +12 -0
- package/plugins/skills/causal/SKILL.md +74 -0
- package/plugins/skills/change/SKILL.md +80 -0
- package/plugins/skills/decision/SKILL.md +197 -0
- package/plugins/skills/deduplicate/SKILL.md +41 -0
- package/plugins/skills/embed/SKILL.md +230 -0
- package/plugins/skills/explain/SKILL.md +44 -0
- package/plugins/skills/export/SKILL.md +67 -0
- package/plugins/skills/extract/SKILL.md +93 -0
- package/plugins/skills/ingest/SKILL.md +38 -0
- package/plugins/skills/ontology/SKILL.md +89 -0
- package/plugins/skills/policy/SKILL.md +66 -0
- package/plugins/skills/provenance/SKILL.md +70 -0
- package/plugins/skills/query/SKILL.md +84 -0
- package/plugins/skills/reason/SKILL.md +201 -0
- package/plugins/skills/temporal/SKILL.md +164 -0
- package/plugins/skills/validate/SKILL.md +228 -0
- package/plugins/skills/visualize/SKILL.md +249 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type Graph from "graphology";
|
|
2
|
+
|
|
3
|
+
import type { NodeAttributes } from "../../store/graphStore";
|
|
4
|
+
import { GRAPH_THEME, type GraphTheme } from "./graphTheme";
|
|
5
|
+
|
|
6
|
+
export type GraphColorLegendItem = {
|
|
7
|
+
id: string;
|
|
8
|
+
group: string;
|
|
9
|
+
color: string;
|
|
10
|
+
count: number;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
/** Normal semantic color, before selection, distance, or zoom styling. */
|
|
14
|
+
export function getSemanticNodeColor(
|
|
15
|
+
attrs: Pick<NodeAttributes, "baseColor" | "color">,
|
|
16
|
+
theme: GraphTheme = GRAPH_THEME,
|
|
17
|
+
) {
|
|
18
|
+
return String(attrs.baseColor || attrs.color || theme.palette.semantic[0]);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** Use the displayed graph so synthetic groups and filtered views keep their colors. */
|
|
22
|
+
export function buildGraphColorLegend(graph: Graph, theme: GraphTheme = GRAPH_THEME): GraphColorLegendItem[] {
|
|
23
|
+
const entries = new Map<string, GraphColorLegendItem>();
|
|
24
|
+
graph.forEachNode((_id, attrs) => {
|
|
25
|
+
if (attrs.hidden) return;
|
|
26
|
+
const group = String(attrs.semanticGroup || attrs.nodeType || "entity");
|
|
27
|
+
// Focused clones bake interaction colors into baseColor; keep those out of the semantic key.
|
|
28
|
+
const color = String(attrs.semanticBaseColor || getSemanticNodeColor(attrs as NodeAttributes, theme));
|
|
29
|
+
// A synthetic display node can share a semantic label with a different color.
|
|
30
|
+
const id = JSON.stringify([group, color]);
|
|
31
|
+
const current = entries.get(id);
|
|
32
|
+
if (current) current.count += 1;
|
|
33
|
+
else entries.set(id, { id, group, color, count: 1 });
|
|
34
|
+
});
|
|
35
|
+
return [...entries.values()].sort((a, b) => a.group.localeCompare(b.group) || a.color.localeCompare(b.color));
|
|
36
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
export const GRAPH_THEME = {
|
|
2
|
+
background: {
|
|
3
|
+
canvas: "#050816",
|
|
4
|
+
shell: "#0A1021",
|
|
5
|
+
panel: "#10182C",
|
|
6
|
+
grid: "rgba(93, 124, 168, 0.08)",
|
|
7
|
+
vignette: "rgba(2, 4, 10, 0.88)",
|
|
8
|
+
},
|
|
9
|
+
nodes: {
|
|
10
|
+
palette: [
|
|
11
|
+
"#3CE7FF",
|
|
12
|
+
"#23D7C8",
|
|
13
|
+
"#5DA9FF",
|
|
14
|
+
"#9B6BFF",
|
|
15
|
+
"#FF4FD8",
|
|
16
|
+
"#FF9A3C",
|
|
17
|
+
"#B9FF3B",
|
|
18
|
+
],
|
|
19
|
+
selected: "#FFC857",
|
|
20
|
+
selectedGlow: "rgba(255, 200, 87, 0.36)",
|
|
21
|
+
hoverGlow: "rgba(60, 231, 255, 0.32)",
|
|
22
|
+
border: "#07111C",
|
|
23
|
+
subduedAlpha: 0.1,
|
|
24
|
+
},
|
|
25
|
+
edges: {
|
|
26
|
+
baseColor: "rgba(126, 162, 214, 0.08)",
|
|
27
|
+
subduedColor: "rgba(126, 162, 214, 0.03)",
|
|
28
|
+
hoverColor: "rgba(94, 198, 255, 0.9)",
|
|
29
|
+
pathColor: "rgba(255, 192, 92, 0.95)",
|
|
30
|
+
focusColor: "rgba(175, 191, 255, 0.26)",
|
|
31
|
+
},
|
|
32
|
+
motion: {
|
|
33
|
+
hoverMs: 160,
|
|
34
|
+
cameraMs: 480,
|
|
35
|
+
},
|
|
36
|
+
thresholds: {
|
|
37
|
+
interactiveLayoutMaxNodes: 8000,
|
|
38
|
+
stagedLayoutMaxNodes: 25000,
|
|
39
|
+
focusNeighborCap: 18,
|
|
40
|
+
focusPrimaryLabels: 8,
|
|
41
|
+
particleEdgeCap: 32,
|
|
42
|
+
},
|
|
43
|
+
} as const;
|
|
44
|
+
|
|
45
|
+
export const FORCE_ATLAS_SETTINGS = {
|
|
46
|
+
getEdgeWeight: "weight",
|
|
47
|
+
settings: {
|
|
48
|
+
barnesHutOptimize: true,
|
|
49
|
+
barnesHutTheta: 0.6,
|
|
50
|
+
linLogMode: true,
|
|
51
|
+
outboundAttractionDistribution: true,
|
|
52
|
+
strongGravityMode: false,
|
|
53
|
+
gravity: 0.14,
|
|
54
|
+
scalingRatio: 4.8,
|
|
55
|
+
slowDown: 6,
|
|
56
|
+
edgeWeightInfluence: 1,
|
|
57
|
+
adjustSizes: true,
|
|
58
|
+
},
|
|
59
|
+
} as const;
|
|
60
|
+
|
|
61
|
+
export function clamp(min: number, value: number, max: number): number {
|
|
62
|
+
return Math.min(max, Math.max(min, value));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export function hashString(value: string): number {
|
|
66
|
+
let hash = 0;
|
|
67
|
+
for (let index = 0; index < value.length; index += 1) {
|
|
68
|
+
hash = (hash << 5) - hash + value.charCodeAt(index);
|
|
69
|
+
hash |= 0;
|
|
70
|
+
}
|
|
71
|
+
return Math.abs(hash);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
export function withAlpha(color: string | undefined, alpha: number): string {
|
|
75
|
+
if (!color) {
|
|
76
|
+
return `rgba(130, 145, 165, ${alpha})`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (color.startsWith("#")) {
|
|
80
|
+
const hex = color.slice(1);
|
|
81
|
+
const normalized = hex.length === 3
|
|
82
|
+
? hex.split("").map((char) => `${char}${char}`).join("")
|
|
83
|
+
: hex;
|
|
84
|
+
|
|
85
|
+
if (normalized.length === 6) {
|
|
86
|
+
const red = Number.parseInt(normalized.slice(0, 2), 16);
|
|
87
|
+
const green = Number.parseInt(normalized.slice(2, 4), 16);
|
|
88
|
+
const blue = Number.parseInt(normalized.slice(4, 6), 16);
|
|
89
|
+
return `rgba(${red}, ${green}, ${blue}, ${alpha})`;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
if (color.startsWith("rgba(")) {
|
|
94
|
+
return color.replace(/rgba\(([^)]+),\s*[\d.]+\)/, `rgba($1, ${alpha})`);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (color.startsWith("rgb(")) {
|
|
98
|
+
return color.replace("rgb(", "rgba(").replace(")", `, ${alpha})`);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return `rgba(130, 145, 165, ${alpha})`;
|
|
102
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { GraphEntityShapeVariant } from "./graphTheme";
|
|
2
|
+
|
|
3
|
+
export const ENTITY_SHAPE_ALIASES: Array<[GraphEntityShapeVariant, RegExp]> = [
|
|
4
|
+
["biomolecule", /\b(gene|protein|enzyme|receptor|target|transcript|rna|dna|mirna|biomolecule|peptide)\b/i],
|
|
5
|
+
["condition", /\b(disease|condition|phenotype|symptom|disorder|syndrome|diagnosis|pathology|trait)\b/i],
|
|
6
|
+
["compound", /\b(drug|chemical|compound|metabolite|molecule|small[_\s-]?molecule|ligand|therapeutic|medication|substance)\b/i],
|
|
7
|
+
["process", /\b(pathway|process|mechanism|function|ontology|biological[_\s-]?process|cellular[_\s-]?process|program|module)\b/i],
|
|
8
|
+
];
|
|
9
|
+
|
|
10
|
+
export function classifyEntityShape(
|
|
11
|
+
nodeType?: string,
|
|
12
|
+
semanticGroup?: string,
|
|
13
|
+
content?: string,
|
|
14
|
+
properties?: Record<string, unknown>,
|
|
15
|
+
): GraphEntityShapeVariant {
|
|
16
|
+
const values = [
|
|
17
|
+
nodeType,
|
|
18
|
+
semanticGroup,
|
|
19
|
+
content,
|
|
20
|
+
String(properties?.type ?? ""),
|
|
21
|
+
String(properties?.category ?? ""),
|
|
22
|
+
String(properties?.label ?? ""),
|
|
23
|
+
]
|
|
24
|
+
.filter((value) => typeof value === "string" && value.trim().length > 0)
|
|
25
|
+
.join(" ");
|
|
26
|
+
|
|
27
|
+
for (const [shape, pattern] of ENTITY_SHAPE_ALIASES) {
|
|
28
|
+
if (pattern.test(values)) {
|
|
29
|
+
return shape;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return "entity";
|
|
34
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import type { GraphLoadPhase, GraphLoadProgress, GraphLoadProgressKind, GraphLayoutSource, GraphLayoutState } from "./types";
|
|
2
|
+
|
|
3
|
+
export const GRAPH_LOAD_STAGE_SEQUENCE: Exclude<GraphLoadPhase, "ready">[] = [
|
|
4
|
+
"bootstrapping",
|
|
5
|
+
"fetching_nodes",
|
|
6
|
+
"fetching_edges",
|
|
7
|
+
"computing_styling",
|
|
8
|
+
"hydrating_scene",
|
|
9
|
+
"stabilizing_layout",
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export function getGraphLoadTitle(phase: GraphLoadPhase): string {
|
|
13
|
+
switch (phase) {
|
|
14
|
+
case "bootstrapping":
|
|
15
|
+
return "Preparing graph session";
|
|
16
|
+
case "fetching_nodes":
|
|
17
|
+
return "Loading nodes";
|
|
18
|
+
case "fetching_edges":
|
|
19
|
+
return "Loading relationships";
|
|
20
|
+
case "computing_styling":
|
|
21
|
+
return "Computing node styling";
|
|
22
|
+
case "hydrating_scene":
|
|
23
|
+
return "Hydrating graph scene";
|
|
24
|
+
case "stabilizing_layout":
|
|
25
|
+
return "Stabilizing layout";
|
|
26
|
+
case "ready":
|
|
27
|
+
default:
|
|
28
|
+
return "Graph ready";
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function getGraphLoadStageLabel(phase: Exclude<GraphLoadPhase, "ready">): string {
|
|
33
|
+
switch (phase) {
|
|
34
|
+
case "bootstrapping":
|
|
35
|
+
return "Prepare";
|
|
36
|
+
case "fetching_nodes":
|
|
37
|
+
return "Nodes";
|
|
38
|
+
case "fetching_edges":
|
|
39
|
+
return "Relations";
|
|
40
|
+
case "computing_styling":
|
|
41
|
+
return "Styling";
|
|
42
|
+
case "hydrating_scene":
|
|
43
|
+
return "Scene";
|
|
44
|
+
case "stabilizing_layout":
|
|
45
|
+
return "Layout";
|
|
46
|
+
default:
|
|
47
|
+
return "Stage";
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function createGraphLoadProgress(input: {
|
|
52
|
+
phase: GraphLoadPhase;
|
|
53
|
+
message: string;
|
|
54
|
+
progressKind: GraphLoadProgressKind;
|
|
55
|
+
loaded?: number | null;
|
|
56
|
+
total?: number | null;
|
|
57
|
+
nodesLoaded?: number;
|
|
58
|
+
nodesTotal?: number | null;
|
|
59
|
+
edgesLoaded?: number;
|
|
60
|
+
edgesTotal?: number | null;
|
|
61
|
+
showGraphBehind?: boolean;
|
|
62
|
+
layoutSource?: GraphLayoutSource;
|
|
63
|
+
layoutState?: GraphLayoutState;
|
|
64
|
+
}): GraphLoadProgress {
|
|
65
|
+
const phaseIndex = GRAPH_LOAD_STAGE_SEQUENCE.indexOf(input.phase as Exclude<GraphLoadPhase, "ready">);
|
|
66
|
+
|
|
67
|
+
return {
|
|
68
|
+
phase: input.phase,
|
|
69
|
+
title: getGraphLoadTitle(input.phase),
|
|
70
|
+
message: input.message,
|
|
71
|
+
progressKind: input.progressKind,
|
|
72
|
+
loaded: input.loaded ?? null,
|
|
73
|
+
total: input.total ?? null,
|
|
74
|
+
nodesLoaded: input.nodesLoaded ?? 0,
|
|
75
|
+
nodesTotal: input.nodesTotal ?? null,
|
|
76
|
+
edgesLoaded: input.edgesLoaded ?? 0,
|
|
77
|
+
edgesTotal: input.edgesTotal ?? null,
|
|
78
|
+
showGraphBehind: input.showGraphBehind ?? false,
|
|
79
|
+
stageIndex: phaseIndex >= 0 ? phaseIndex + 1 : GRAPH_LOAD_STAGE_SEQUENCE.length,
|
|
80
|
+
stageCount: GRAPH_LOAD_STAGE_SEQUENCE.length,
|
|
81
|
+
layoutSource: input.layoutSource,
|
|
82
|
+
layoutState: input.layoutState,
|
|
83
|
+
};
|
|
84
|
+
}
|