yangdx
commited on
Commit
·
07ccc72
1
Parent(s):
2fbd277
Udate node types
Browse files
lightrag/api/webui/assets/{index-BMYavbuW.js → index-BaqyLpkv.js}
RENAMED
Binary files a/lightrag/api/webui/assets/index-BMYavbuW.js and b/lightrag/api/webui/assets/index-BaqyLpkv.js differ
|
|
lightrag/api/webui/assets/{index-CGcFmqa-.css → index-CTB4Vp_z.css}
RENAMED
Binary files a/lightrag/api/webui/assets/index-CGcFmqa-.css and b/lightrag/api/webui/assets/index-CTB4Vp_z.css differ
|
|
lightrag/api/webui/index.html
CHANGED
Binary files a/lightrag/api/webui/index.html and b/lightrag/api/webui/index.html differ
|
|
lightrag_webui/src/components/graph/Legend.tsx
CHANGED
@@ -34,7 +34,7 @@ const Legend: React.FC<LegendProps> = ({ className }) => {
|
|
34 |
return (
|
35 |
<Card className={`p-2 max-w-xs ${className}`}>
|
36 |
<h3 className="text-sm font-medium mb-2">{t('graphPanel.legend')}</h3>
|
37 |
-
<ScrollArea className="max-h-
|
38 |
<div className="flex flex-col gap-1">
|
39 |
{Array.from(typeColorMap.entries()).map(([type, color]) => (
|
40 |
<div key={type} className="flex items-center gap-2">
|
|
|
34 |
return (
|
35 |
<Card className={`p-2 max-w-xs ${className}`}>
|
36 |
<h3 className="text-sm font-medium mb-2">{t('graphPanel.legend')}</h3>
|
37 |
+
<ScrollArea className="max-h-80">
|
38 |
<div className="flex flex-col gap-1">
|
39 |
{Array.from(typeColorMap.entries()).map(([type, color]) => (
|
40 |
<div key={type} className="flex items-center gap-2">
|
lightrag_webui/src/hooks/useLightragGraph.tsx
CHANGED
@@ -11,20 +11,16 @@ import { useSettingsStore } from '@/stores/settings'
|
|
11 |
|
12 |
import seedrandom from 'seedrandom'
|
13 |
|
14 |
-
// 同义词列表 - 用于快速查找节点类型
|
15 |
const TYPE_SYNONYMS: Record<string, string> = {
|
16 |
-
// unknown 类型及其同义词
|
17 |
'unknown': 'unknown',
|
18 |
'未知': 'unknown',
|
19 |
'other': 'unknown',
|
20 |
|
21 |
-
// category 类型及其同义词
|
22 |
'category': 'category',
|
23 |
'类别': 'category',
|
24 |
'type': 'category',
|
25 |
'分类': 'category',
|
26 |
|
27 |
-
// organization 类型及其同义词
|
28 |
'organization': 'organization',
|
29 |
'组织': 'organization',
|
30 |
'org': 'organization',
|
@@ -32,32 +28,27 @@ const TYPE_SYNONYMS: Record<string, string> = {
|
|
32 |
'公司': 'organization',
|
33 |
'机构': 'organization',
|
34 |
|
35 |
-
// event 类型及其同义词
|
36 |
'event': 'event',
|
37 |
'事件': 'event',
|
38 |
'activity': 'event',
|
39 |
'活动': 'event',
|
40 |
|
41 |
-
// person 类型及其同义词
|
42 |
'person': 'person',
|
43 |
'人物': 'person',
|
44 |
'people': 'person',
|
45 |
'human': 'person',
|
46 |
'人': 'person',
|
47 |
|
48 |
-
// animal 类型及其同义词
|
49 |
'animal': 'animal',
|
50 |
'动物': 'animal',
|
51 |
'creature': 'animal',
|
52 |
'生物': 'animal',
|
53 |
|
54 |
-
// geo 类型及其同义词
|
55 |
'geo': 'geo',
|
56 |
'地理': 'geo',
|
57 |
'geography': 'geo',
|
58 |
'地域': 'geo',
|
59 |
|
60 |
-
// location 类型及其同义词
|
61 |
'location': 'location',
|
62 |
'地点': 'location',
|
63 |
'place': 'location',
|
@@ -65,23 +56,25 @@ const TYPE_SYNONYMS: Record<string, string> = {
|
|
65 |
'位置': 'location',
|
66 |
'地址': 'location',
|
67 |
|
68 |
-
// technology 类型及其同义词
|
69 |
'technology': 'technology',
|
70 |
'技术': 'technology',
|
71 |
'tech': 'technology',
|
72 |
'科技': 'technology',
|
73 |
|
74 |
-
// equipment 类型及其同义词
|
75 |
'equipment': 'equipment',
|
76 |
'设备': 'equipment',
|
77 |
'device': 'equipment',
|
78 |
'装备': 'equipment',
|
79 |
|
80 |
-
// weapon 类型及其同义词
|
81 |
'weapon': 'weapon',
|
82 |
'武器': 'weapon',
|
83 |
'arms': 'weapon',
|
84 |
-
'军火': 'weapon'
|
|
|
|
|
|
|
|
|
|
|
85 |
};
|
86 |
|
87 |
// 节点类型到颜色的映射
|
@@ -97,16 +90,16 @@ const NODE_TYPE_COLORS: Record<string, string> = {
|
|
97 |
'technology': '#b300b3', // Purple
|
98 |
'equipment': '#2F4F4F', // DarkSlateGray
|
99 |
'weapon': '#4421af', // DeepPurple
|
|
|
100 |
};
|
101 |
|
102 |
// Extended colors pool - Used for unknown node types
|
103 |
const EXTENDED_COLORS = [
|
104 |
-
'#0f558a', // NavyBlue
|
105 |
'#cd071e', // ChinaRed
|
106 |
-
'#5a2c6d', // DeepViolet
|
107 |
'#0000ff', // Blue
|
108 |
-
'#00cc00', // Green
|
109 |
'#9b3a31', // DarkBrown
|
|
|
|
|
110 |
'#003366', // DarkBlue
|
111 |
'#00CED1', // DarkTurquoise
|
112 |
'#DEB887', // BurlyWood
|
|
|
11 |
|
12 |
import seedrandom from 'seedrandom'
|
13 |
|
|
|
14 |
const TYPE_SYNONYMS: Record<string, string> = {
|
|
|
15 |
'unknown': 'unknown',
|
16 |
'未知': 'unknown',
|
17 |
'other': 'unknown',
|
18 |
|
|
|
19 |
'category': 'category',
|
20 |
'类别': 'category',
|
21 |
'type': 'category',
|
22 |
'分类': 'category',
|
23 |
|
|
|
24 |
'organization': 'organization',
|
25 |
'组织': 'organization',
|
26 |
'org': 'organization',
|
|
|
28 |
'公司': 'organization',
|
29 |
'机构': 'organization',
|
30 |
|
|
|
31 |
'event': 'event',
|
32 |
'事件': 'event',
|
33 |
'activity': 'event',
|
34 |
'活动': 'event',
|
35 |
|
|
|
36 |
'person': 'person',
|
37 |
'人物': 'person',
|
38 |
'people': 'person',
|
39 |
'human': 'person',
|
40 |
'人': 'person',
|
41 |
|
|
|
42 |
'animal': 'animal',
|
43 |
'动物': 'animal',
|
44 |
'creature': 'animal',
|
45 |
'生物': 'animal',
|
46 |
|
|
|
47 |
'geo': 'geo',
|
48 |
'地理': 'geo',
|
49 |
'geography': 'geo',
|
50 |
'地域': 'geo',
|
51 |
|
|
|
52 |
'location': 'location',
|
53 |
'地点': 'location',
|
54 |
'place': 'location',
|
|
|
56 |
'位置': 'location',
|
57 |
'地址': 'location',
|
58 |
|
|
|
59 |
'technology': 'technology',
|
60 |
'技术': 'technology',
|
61 |
'tech': 'technology',
|
62 |
'科技': 'technology',
|
63 |
|
|
|
64 |
'equipment': 'equipment',
|
65 |
'设备': 'equipment',
|
66 |
'device': 'equipment',
|
67 |
'装备': 'equipment',
|
68 |
|
|
|
69 |
'weapon': 'weapon',
|
70 |
'武器': 'weapon',
|
71 |
'arms': 'weapon',
|
72 |
+
'军火': 'weapon',
|
73 |
+
|
74 |
+
'object': 'object',
|
75 |
+
'物品': 'object',
|
76 |
+
'stuff': 'object',
|
77 |
+
'物体': 'object'
|
78 |
};
|
79 |
|
80 |
// 节点类型到颜色的映射
|
|
|
90 |
'technology': '#b300b3', // Purple
|
91 |
'equipment': '#2F4F4F', // DarkSlateGray
|
92 |
'weapon': '#4421af', // DeepPurple
|
93 |
+
'object': '#00cc00', // Green
|
94 |
};
|
95 |
|
96 |
// Extended colors pool - Used for unknown node types
|
97 |
const EXTENDED_COLORS = [
|
|
|
98 |
'#cd071e', // ChinaRed
|
|
|
99 |
'#0000ff', // Blue
|
|
|
100 |
'#9b3a31', // DarkBrown
|
101 |
+
'#0f558a', // NavyBlue
|
102 |
+
'#5a2c6d', // DeepViolet
|
103 |
'#003366', // DarkBlue
|
104 |
'#00CED1', // DarkTurquoise
|
105 |
'#DEB887', // BurlyWood
|