Udate node types
This commit is contained in:
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
4
lightrag/api/webui/index.html
generated
4
lightrag/api/webui/index.html
generated
@@ -8,8 +8,8 @@
|
|||||||
<link rel="icon" type="image/svg+xml" href="logo.png" />
|
<link rel="icon" type="image/svg+xml" href="logo.png" />
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||||
<title>Lightrag</title>
|
<title>Lightrag</title>
|
||||||
<script type="module" crossorigin src="/webui/assets/index-BMYavbuW.js"></script>
|
<script type="module" crossorigin src="/webui/assets/index-BaqyLpkv.js"></script>
|
||||||
<link rel="stylesheet" crossorigin href="/webui/assets/index-CGcFmqa-.css">
|
<link rel="stylesheet" crossorigin href="/webui/assets/index-CTB4Vp_z.css">
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div id="root"></div>
|
<div id="root"></div>
|
||||||
|
@@ -34,7 +34,7 @@ const Legend: React.FC<LegendProps> = ({ className }) => {
|
|||||||
return (
|
return (
|
||||||
<Card className={`p-2 max-w-xs ${className}`}>
|
<Card className={`p-2 max-w-xs ${className}`}>
|
||||||
<h3 className="text-sm font-medium mb-2">{t('graphPanel.legend')}</h3>
|
<h3 className="text-sm font-medium mb-2">{t('graphPanel.legend')}</h3>
|
||||||
<ScrollArea className="max-h-50">
|
<ScrollArea className="max-h-80">
|
||||||
<div className="flex flex-col gap-1">
|
<div className="flex flex-col gap-1">
|
||||||
{Array.from(typeColorMap.entries()).map(([type, color]) => (
|
{Array.from(typeColorMap.entries()).map(([type, color]) => (
|
||||||
<div key={type} className="flex items-center gap-2">
|
<div key={type} className="flex items-center gap-2">
|
||||||
|
@@ -11,20 +11,16 @@ import { useSettingsStore } from '@/stores/settings'
|
|||||||
|
|
||||||
import seedrandom from 'seedrandom'
|
import seedrandom from 'seedrandom'
|
||||||
|
|
||||||
// 同义词列表 - 用于快速查找节点类型
|
|
||||||
const TYPE_SYNONYMS: Record<string, string> = {
|
const TYPE_SYNONYMS: Record<string, string> = {
|
||||||
// unknown 类型及其同义词
|
|
||||||
'unknown': 'unknown',
|
'unknown': 'unknown',
|
||||||
'未知': 'unknown',
|
'未知': 'unknown',
|
||||||
'other': 'unknown',
|
'other': 'unknown',
|
||||||
|
|
||||||
// category 类型及其同义词
|
|
||||||
'category': 'category',
|
'category': 'category',
|
||||||
'类别': 'category',
|
'类别': 'category',
|
||||||
'type': 'category',
|
'type': 'category',
|
||||||
'分类': 'category',
|
'分类': 'category',
|
||||||
|
|
||||||
// organization 类型及其同义词
|
|
||||||
'organization': 'organization',
|
'organization': 'organization',
|
||||||
'组织': 'organization',
|
'组织': 'organization',
|
||||||
'org': 'organization',
|
'org': 'organization',
|
||||||
@@ -32,32 +28,27 @@ const TYPE_SYNONYMS: Record<string, string> = {
|
|||||||
'公司': 'organization',
|
'公司': 'organization',
|
||||||
'机构': 'organization',
|
'机构': 'organization',
|
||||||
|
|
||||||
// event 类型及其同义词
|
|
||||||
'event': 'event',
|
'event': 'event',
|
||||||
'事件': 'event',
|
'事件': 'event',
|
||||||
'activity': 'event',
|
'activity': 'event',
|
||||||
'活动': 'event',
|
'活动': 'event',
|
||||||
|
|
||||||
// person 类型及其同义词
|
|
||||||
'person': 'person',
|
'person': 'person',
|
||||||
'人物': 'person',
|
'人物': 'person',
|
||||||
'people': 'person',
|
'people': 'person',
|
||||||
'human': 'person',
|
'human': 'person',
|
||||||
'人': 'person',
|
'人': 'person',
|
||||||
|
|
||||||
// animal 类型及其同义词
|
|
||||||
'animal': 'animal',
|
'animal': 'animal',
|
||||||
'动物': 'animal',
|
'动物': 'animal',
|
||||||
'creature': 'animal',
|
'creature': 'animal',
|
||||||
'生物': 'animal',
|
'生物': 'animal',
|
||||||
|
|
||||||
// geo 类型及其同义词
|
|
||||||
'geo': 'geo',
|
'geo': 'geo',
|
||||||
'地理': 'geo',
|
'地理': 'geo',
|
||||||
'geography': 'geo',
|
'geography': 'geo',
|
||||||
'地域': 'geo',
|
'地域': 'geo',
|
||||||
|
|
||||||
// location 类型及其同义词
|
|
||||||
'location': 'location',
|
'location': 'location',
|
||||||
'地点': 'location',
|
'地点': 'location',
|
||||||
'place': 'location',
|
'place': 'location',
|
||||||
@@ -65,23 +56,25 @@ const TYPE_SYNONYMS: Record<string, string> = {
|
|||||||
'位置': 'location',
|
'位置': 'location',
|
||||||
'地址': 'location',
|
'地址': 'location',
|
||||||
|
|
||||||
// technology 类型及其同义词
|
|
||||||
'technology': 'technology',
|
'technology': 'technology',
|
||||||
'技术': 'technology',
|
'技术': 'technology',
|
||||||
'tech': 'technology',
|
'tech': 'technology',
|
||||||
'科技': 'technology',
|
'科技': 'technology',
|
||||||
|
|
||||||
// equipment 类型及其同义词
|
|
||||||
'equipment': 'equipment',
|
'equipment': 'equipment',
|
||||||
'设备': 'equipment',
|
'设备': 'equipment',
|
||||||
'device': 'equipment',
|
'device': 'equipment',
|
||||||
'装备': 'equipment',
|
'装备': 'equipment',
|
||||||
|
|
||||||
// weapon 类型及其同义词
|
|
||||||
'weapon': 'weapon',
|
'weapon': 'weapon',
|
||||||
'武器': 'weapon',
|
'武器': 'weapon',
|
||||||
'arms': 'weapon',
|
'arms': 'weapon',
|
||||||
'军火': 'weapon'
|
'军火': 'weapon',
|
||||||
|
|
||||||
|
'object': 'object',
|
||||||
|
'物品': 'object',
|
||||||
|
'stuff': 'object',
|
||||||
|
'物体': 'object'
|
||||||
};
|
};
|
||||||
|
|
||||||
// 节点类型到颜色的映射
|
// 节点类型到颜色的映射
|
||||||
@@ -97,16 +90,16 @@ const NODE_TYPE_COLORS: Record<string, string> = {
|
|||||||
'technology': '#b300b3', // Purple
|
'technology': '#b300b3', // Purple
|
||||||
'equipment': '#2F4F4F', // DarkSlateGray
|
'equipment': '#2F4F4F', // DarkSlateGray
|
||||||
'weapon': '#4421af', // DeepPurple
|
'weapon': '#4421af', // DeepPurple
|
||||||
|
'object': '#00cc00', // Green
|
||||||
};
|
};
|
||||||
|
|
||||||
// Extended colors pool - Used for unknown node types
|
// Extended colors pool - Used for unknown node types
|
||||||
const EXTENDED_COLORS = [
|
const EXTENDED_COLORS = [
|
||||||
'#0f558a', // NavyBlue
|
|
||||||
'#cd071e', // ChinaRed
|
'#cd071e', // ChinaRed
|
||||||
'#5a2c6d', // DeepViolet
|
|
||||||
'#0000ff', // Blue
|
'#0000ff', // Blue
|
||||||
'#00cc00', // Green
|
|
||||||
'#9b3a31', // DarkBrown
|
'#9b3a31', // DarkBrown
|
||||||
|
'#0f558a', // NavyBlue
|
||||||
|
'#5a2c6d', // DeepViolet
|
||||||
'#003366', // DarkBlue
|
'#003366', // DarkBlue
|
||||||
'#00CED1', // DarkTurquoise
|
'#00CED1', // DarkTurquoise
|
||||||
'#DEB887', // BurlyWood
|
'#DEB887', // BurlyWood
|
||||||
|
Reference in New Issue
Block a user