Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
1c79876
commit
Anchel123 Dec 9, 2025
95ef298
commit
Anchel123 Dec 9, 2025
30ee24c
commit
Anchel123 Dec 11, 2025
2c41719
Merge branch 'staging' into falkordb-canvas
barakb Dec 14, 2025
7a83ed4
commit
Anchel123 Dec 14, 2025
6e45bea
commit
Anchel123 Dec 15, 2025
eb33091
commit
Anchel123 Dec 15, 2025
826a894
commit
Anchel123 Dec 17, 2025
3dc0071
commit
Anchel123 Dec 17, 2025
f1170b3
Remove console.log statements from viewport handling in ForceGraph co…
Anchel123 Dec 17, 2025
244d8d3
Add conditional check before setting viewport and graph data in Force…
Anchel123 Dec 17, 2025
d90e9a4
Enhance DataPanel and DataTable components to utilize canvasRef for g…
Anchel123 Dec 17, 2025
6eddae9
Merge branch 'staging' into falkordb-canvas
Anchel123 Dec 17, 2025
2681375
Update falkordb-canvas dependency to version 0.0.3 and remove unused …
Anchel123 Dec 18, 2025
14d4235
Refactor imports to use @falkordb/canvas and update package dependencies
Anchel123 Dec 18, 2025
69c1f02
Update @falkordb/canvas dependency to version 0.0.7 in package.json a…
Anchel123 Dec 18, 2025
59c8bc8
Enhance ForceGraph component to dynamically update canvas dimensions …
Anchel123 Dec 21, 2025
b8cb405
Update @falkordb/canvas dependency to version 0.0.8 in package.json a…
Anchel123 Dec 24, 2025
17b5f38
Update @falkordb/canvas dependency to version 0.0.9 and remove unused…
Anchel123 Dec 25, 2025
01a651d
Refactor code structure and update package dependencies
Anchel123 Dec 30, 2025
59d22ae
Merge remote-tracking branch 'origin/staging' into falkordb-canvas
Anchel123 Dec 30, 2025
083ced9
Refactor Graph class to improve color generation and optimize node vi…
Anchel123 Dec 30, 2025
372ff81
Refactor CustomizeStylePanel to replace ViewportContext with ForceGra…
Anchel123 Dec 30, 2025
b96c9b5
update packages
gkorland Dec 30, 2025
dff98ad
update lock
gkorland Dec 30, 2025
f4c8ed3
update lock
gkorland Dec 30, 2025
a7f4e60
Implement feature X to enhance user experience and optimize performance
Anchel123 Dec 30, 2025
b6e328a
Fix typo in fields array and restore Monitor page component
Anchel123 Dec 30, 2025
1d53656
update lock
gkorland Dec 30, 2025
f4f8c82
Refactor code structure for improved readability and maintainability
Anchel123 Dec 30, 2025
50d0526
Update Node.js version in Dockerfile and bump fsevents dependency in …
Anchel123 Dec 30, 2025
e1a6274
Update @falkordb/canvas dependency to version 0.0.13 in package.json …
Anchel123 Dec 30, 2025
538131f
Update @falkordb/canvas dependency to version 0.0.14 in package.json …
Anchel123 Dec 30, 2025
7370ea9
Fix: update data-engine-status check from "stop" to "stopped"
Anchel123 Dec 30, 2025
9224248
Enhance graph functionality with CORS support, improved node styling,…
Anchel123 Jan 1, 2026
f943a26
chore: update @falkordb/canvas dependency to version 0.0.21
Anchel123 Jan 4, 2026
500fa11
Fix: ensure canvas node size defaults to existing size if not provided
Anchel123 Jan 4, 2026
cf1f22c
Fix: ensure handleClose also calls handleCancel to revert changes
Anchel123 Jan 5, 2026
0a0a165
Refactor: remove CORS headers handling from API routes for cleaner re…
Anchel123 Jan 5, 2026
24df5a8
Fix canvas animation wait after web component migration
Naseem77 Jan 5, 2026
79c0f86
increase polling timing for canvas animation
Naseem77 Jan 5, 2026
a1746c9
Fix: update locator for node canvas tooltip to use class attribute se…
Anchel123 Jan 5, 2026
4497e2d
Fix: correct logic for history query counter update on click event
Anchel123 Jan 5, 2026
187e0d1
Refactor code style for consistency and readability across test files
Anchel123 Jan 5, 2026
5d3a9af
Fix: update displayName assignment to use EMPTY_DISPLAY_NAME constant…
Anchel123 Jan 5, 2026
17b3ac7
Fix: support new canvas data structure in test helpers after web comp…
Naseem77 Jan 5, 2026
262f01d
Fix: update handleCooldown type to accept only zero as a valid argument
Anchel123 Jan 5, 2026
b839af7
Fix: simplify color assignment logic in Graph class and ensure handle…
Anchel123 Jan 5, 2026
893e394
Fix: update graph data retrieval to handle potential undefined values…
Anchel123 Jan 6, 2026
3fc24f8
Fix: implement encryption utilities for secure storage of sensitive d…
Anchel123 Jan 7, 2026
354e215
Fix: update encryption key storage constant for consistency
Anchel123 Jan 7, 2026
4f646a9
Fix: update @falkordb/canvas dependency to version 0.0.22
Anchel123 Jan 7, 2026
b5e898b
Merge branch 'staging' into falkordb-canvas
Naseem77 Jan 8, 2026
68d3b8e
fix customize style tests
Naseem77 Jan 8, 2026
7421aa3
add checking for waitForCanvasAnimationToEnd function
Naseem77 Jan 8, 2026
71add1d
Refactor: update @falkordb/canvas dependency to local path and remove…
Anchel123 Jan 8, 2026
ee55e9b
Fix: update @falkordb/canvas dependency to version 0.0.23
Anchel123 Jan 8, 2026
5ded74c
Fix: enhance disabled state checks and improve error handling in encr…
Anchel123 Jan 11, 2026
e37628a
Merge remote-tracking branch 'origin/staging' into falkordb-canvas
Anchel123 Jan 11, 2026
1856d33
Implement feature X to enhance user experience and optimize performance
Anchel123 Jan 11, 2026
75b2d6a
Fix: update targetSelector in TutorialStep and add data-testid to Gra…
Anchel123 Jan 11, 2026
f6dfe39
Fix: remove debugger statements from ProvidersWithSession function
Anchel123 Jan 11, 2026
1cd272b
remove test only
Naseem77 Jan 11, 2026
0c2004a
Merge branch 'falkordb-canvas' of https://github.com/FalkorDB/falkord…
Naseem77 Jan 11, 2026
1b4668c
Fix: update encryption key storage constant for consistency
Anchel123 Jan 11, 2026
3ac89aa
Merge branch 'falkordb-canvas' of https://github.com/FalkorDB/falkord…
Anchel123 Jan 11, 2026
d1aed9e
Fix: improve selection logic for elements in ForceGraph component
Anchel123 Jan 11, 2026
b3d36dd
Fix: update canvas dependency to version 0.0.24 and improve error han…
Anchel123 Jan 12, 2026
cc48414
Merge branch 'staging' into falkordb-canvas
Anchel123 Jan 12, 2026
ecf2832
fix: add missing semicolon to improve code consistency
Anchel123 Jan 12, 2026
8730986
fix: refine condition in selectedElements logic and remove console log
Anchel123 Jan 12, 2026
b75f523
fix: remove 'only' from graph relation and connected node deletion tests
Anchel123 Jan 12, 2026
6db02c6
fix: add data-key attribute for improved element selection in Chat co…
Anchel123 Jan 12, 2026
602d9b6
fix chat tests
Naseem77 Jan 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@
"*.js",
"*.jsx"
],
"excludedFiles": [
"*.d.ts"
],
"parserOptions": {
"project": [
"./tsconfig.json"
Expand Down
97 changes: 39 additions & 58 deletions app/api/graph/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
/* eslint-disable no-param-reassign */
/* eslint-disable @typescript-eslint/no-explicit-any */

import { LinkObject, NodeObject } from "react-force-graph-2d";

export type Value = string | number | boolean;

export type HistoryQuery = {
Expand Down Expand Up @@ -52,36 +50,31 @@ const getSchemaValue = (value: string): string[] => {
return [type, description, unique, required];
};

export type Node = NodeObject<{
export type Node = {
id: number;
labels: string[];
color: string;
visible: boolean;
expand: boolean;
collapsed: boolean;
displayName: [string, string];
data: {
[key: string]: any;
};
}>;

export type Link = LinkObject<
Node,
{
id: number;
relationship: string;
color: string;
source: Node;
target: Node;
visible: boolean;
expand: boolean;
collapsed: boolean;
curve: number;
data: {
[key: string]: any;
};
}
>;
};

export type Link = {
id: number;
relationship: string;
color: string;
source: number;
target: number;
visible: boolean;
expand: boolean;
collapsed: boolean;
data: {
[key: string]: any;
};
};

export type GraphData = {
nodes: Node[];
Expand Down Expand Up @@ -114,7 +107,7 @@ export type DataRow = {

export type Data = DataRow[];

export type MemoryValue = number | Map<string, MemoryValue>
export type MemoryValue = number | Map<string, MemoryValue>;

export const DEFAULT_COLORS = [
"hsl(246, 100%, 70%)",
Expand Down Expand Up @@ -464,22 +457,22 @@ export class Graph {
public calculateLinkCurve(link: Link, existingLinks: Link[] = []): number {
const start = link.source;
const end = link.target;

// Find all links between the same nodes (including new links being added)
const allLinks = [...this.elements.links, ...existingLinks];
const sameNodesLinks = allLinks.filter(
(l) =>
(l.source.id === start.id && l.target.id === end.id) ||
(l.target.id === start.id && l.source.id === end.id)
(l.source === start && l.target === end) ||
(l.target === start && l.source === end)
);

let index = sameNodesLinks.findIndex((l) => l.id === link.id);
index = index === -1 ? sameNodesLinks.length : index;

const even = index % 2 === 0;
let curve;

if (start.id === end.id) {
if (start === end) {
if (even) {
curve = Math.floor(-(index / 2)) - 3;
} else {
Expand Down Expand Up @@ -513,7 +506,6 @@ export class Graph {
visible: true,
expand: false,
collapsed,
displayName: ["", ""],
data: {},
};
Object.entries(cell.properties).forEach(([key, value]) => {
Expand Down Expand Up @@ -586,7 +578,6 @@ export class Graph {
expand: false,
collapsed,
visible: true,
displayName: ["", ""],
data: {},
};

Expand All @@ -597,14 +588,13 @@ export class Graph {

link = {
id: cell.id,
source,
target: source,
source: cell.sourceId,
target: cell.destinationId,
relationship: cell.relationshipType,
color: relation.color,
expand: false,
collapsed,
visible: true,
curve: 0,
data: {},
};
} else {
Expand All @@ -623,7 +613,6 @@ export class Graph {
expand: false,
collapsed,
visible: true,
displayName: ["", ""],
data: {},
};

Expand All @@ -640,7 +629,6 @@ export class Graph {
expand: false,
collapsed,
visible: true,
displayName: ["", ""],
data: {},
};

Expand All @@ -651,14 +639,13 @@ export class Graph {

link = {
id: cell.id,
source,
target,
source: cell.sourceId,
target: cell.destinationId,
relationship: cell.relationshipType,
color: relation.color,
expand: false,
collapsed,
visible: true,
curve: 0,
data: {},
};
}
Expand Down Expand Up @@ -742,10 +729,6 @@ export class Graph {
});
});

newElements.filter((element): element is Link => !!element.source).forEach((link) => {
link.curve = this.calculateLinkCurve(link);
});

newElements
.filter((element): element is Node => "labels" in element)
.forEach((node) => {
Expand Down Expand Up @@ -812,21 +795,19 @@ export class Graph {
if (
this.RelationshipsMap.get(link.relationship)!.show &&
visible &&
this.elements.nodes.map((n) => n.id).includes(link.source.id) &&
link.source.visible &&
this.elements.nodes.map((n) => n.id).includes(link.target.id) &&
link.target.visible
this.elements.nodes.find((n) => n.id === link.source)?.visible &&
this.elements.nodes.find((n) => n.id === link.target)?.visible
) {
// eslint-disable-next-line no-param-reassign
link.visible = true;
}

if (
!visible &&
((this.elements.nodes.map((n) => n.id).includes(link.source.id) &&
!link.source.visible) ||
(this.elements.nodes.map((n) => n.id).includes(link.target.id) &&
!link.target.visible))
(this.elements.nodes.find((n) => n.id === link.source)?.visible ===
false ||
this.elements.nodes.find((n) => n.id === link.target)?.visible ===
false)
) {
// eslint-disable-next-line no-param-reassign
link.visible = false;
Expand All @@ -836,7 +817,7 @@ export class Graph {

public removeLinks(ids: number[] = []): Relationship[] {
const links = this.elements.links.filter(
(link) => ids.includes(link.source.id) || ids.includes(link.target.id)
(link) => ids.includes(link.source) || ids.includes(link.target)
);

this.elements = {
Expand All @@ -845,8 +826,8 @@ export class Graph {
.map((link) => {
if (
(ids.length !== 0 && !links.includes(link)) ||
(this.elements.nodes.map((n) => n.id).includes(link.source.id) &&
this.elements.nodes.map((n) => n.id).includes(link.target.id))
(this.elements.nodes.map((n) => n.id).includes(link.source) &&
this.elements.nodes.map((n) => n.id).includes(link.target))
) {
return link;
}
Expand Down Expand Up @@ -880,7 +861,7 @@ export class Graph {
public removeElements(elements: (Node | Link)[]) {
elements.forEach((element) => {
const { id } = element;
const type = !element.source;
const type = "labels" in element;

if (type) {
this.elements.nodes.splice(
Expand Down Expand Up @@ -919,8 +900,8 @@ export class Graph {
}
});

const nodes = elements.filter((n): n is Node => !n.source);
const links = elements.filter((l): l is Link => l.source);
const nodes = elements.filter((n): n is Node => "labels" in n);
const links = elements.filter((l): l is Link => "source" in l);

this.elements = {
nodes: this.elements.nodes.filter(
Expand Down
Loading
Loading