yangdx
commited on
Commit
·
698fa1b
1
Parent(s):
f7e044f
Fix show node label settings error
Browse files
lightrag/api/webui/assets/{index-HWWfOWMh.js → index-DwcJE583.js}
RENAMED
Binary files a/lightrag/api/webui/assets/index-HWWfOWMh.js and b/lightrag/api/webui/assets/index-DwcJE583.js 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/GraphControl.tsx
CHANGED
@@ -36,6 +36,7 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean })
|
|
36 |
const hideUnselectedEdges = useSettingsStore.use.enableHideUnselectedEdges()
|
37 |
const enableEdgeEvents = useSettingsStore.use.enableEdgeEvents()
|
38 |
const renderEdgeLabels = useSettingsStore.use.showEdgeLabel()
|
|
|
39 |
const selectedNode = useGraphStore.use.selectedNode()
|
40 |
const focusedNode = useGraphStore.use.focusedNode()
|
41 |
const selectedEdge = useGraphStore.use.selectedEdge()
|
@@ -117,11 +118,12 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean })
|
|
117 |
const labelColor = isDarkTheme ? Constants.labelColorDarkTheme : undefined
|
118 |
const edgeColor = isDarkTheme ? Constants.edgeColorDarkTheme : undefined
|
119 |
|
120 |
-
// Update
|
121 |
setSettings({
|
122 |
-
// Update
|
123 |
enableEdgeEvents,
|
124 |
renderEdgeLabels,
|
|
|
125 |
|
126 |
// Node reducer for node appearance
|
127 |
nodeReducer: (node, data) => {
|
@@ -207,7 +209,8 @@ const GraphControl = ({ disableHoverEffect }: { disableHoverEffect?: boolean })
|
|
207 |
theme,
|
208 |
hideUnselectedEdges,
|
209 |
enableEdgeEvents,
|
210 |
-
renderEdgeLabels
|
|
|
211 |
])
|
212 |
|
213 |
return null
|
|
|
36 |
const hideUnselectedEdges = useSettingsStore.use.enableHideUnselectedEdges()
|
37 |
const enableEdgeEvents = useSettingsStore.use.enableEdgeEvents()
|
38 |
const renderEdgeLabels = useSettingsStore.use.showEdgeLabel()
|
39 |
+
const renderLabels = useSettingsStore.use.showNodeLabel()
|
40 |
const selectedNode = useGraphStore.use.selectedNode()
|
41 |
const focusedNode = useGraphStore.use.focusedNode()
|
42 |
const selectedEdge = useGraphStore.use.selectedEdge()
|
|
|
118 |
const labelColor = isDarkTheme ? Constants.labelColorDarkTheme : undefined
|
119 |
const edgeColor = isDarkTheme ? Constants.edgeColorDarkTheme : undefined
|
120 |
|
121 |
+
// Update all dynamic settings directly without recreating the sigma container
|
122 |
setSettings({
|
123 |
+
// Update display settings
|
124 |
enableEdgeEvents,
|
125 |
renderEdgeLabels,
|
126 |
+
renderLabels,
|
127 |
|
128 |
// Node reducer for node appearance
|
129 |
nodeReducer: (node, data) => {
|
|
|
209 |
theme,
|
210 |
hideUnselectedEdges,
|
211 |
enableEdgeEvents,
|
212 |
+
renderEdgeLabels,
|
213 |
+
renderLabels
|
214 |
])
|
215 |
|
216 |
return null
|
lightrag_webui/src/features/GraphViewer.tsx
CHANGED
@@ -122,8 +122,6 @@ const GraphViewer = () => {
|
|
122 |
|
123 |
const showPropertyPanel = useSettingsStore.use.showPropertyPanel()
|
124 |
const showNodeSearchBar = useSettingsStore.use.showNodeSearchBar()
|
125 |
-
const renderLabels = useSettingsStore.use.showNodeLabel()
|
126 |
-
|
127 |
const enableNodeDrag = useSettingsStore.use.enableNodeDrag()
|
128 |
|
129 |
// Handle component mount/unmount and tab visibility
|
@@ -145,13 +143,10 @@ const GraphViewer = () => {
|
|
145 |
}, [isGraphTabVisible, shouldRender, isFetching])
|
146 |
|
147 |
// Initialize sigma settings once on component mount
|
148 |
-
//
|
149 |
useEffect(() => {
|
150 |
-
setSigmaSettings(
|
151 |
-
|
152 |
-
renderLabels
|
153 |
-
})
|
154 |
-
}, [renderLabels])
|
155 |
|
156 |
const onSearchFocus = useCallback((value: GraphSearchOption | null) => {
|
157 |
if (value === null) useGraphStore.getState().setFocusedNode(null)
|
|
|
122 |
|
123 |
const showPropertyPanel = useSettingsStore.use.showPropertyPanel()
|
124 |
const showNodeSearchBar = useSettingsStore.use.showNodeSearchBar()
|
|
|
|
|
125 |
const enableNodeDrag = useSettingsStore.use.enableNodeDrag()
|
126 |
|
127 |
// Handle component mount/unmount and tab visibility
|
|
|
143 |
}, [isGraphTabVisible, shouldRender, isFetching])
|
144 |
|
145 |
// Initialize sigma settings once on component mount
|
146 |
+
// All dynamic settings will be updated in GraphControl using useSetSettings
|
147 |
useEffect(() => {
|
148 |
+
setSigmaSettings(defaultSigmaSettings)
|
149 |
+
}, [])
|
|
|
|
|
|
|
150 |
|
151 |
const onSearchFocus = useCallback((value: GraphSearchOption | null) => {
|
152 |
if (value === null) useGraphStore.getState().setFocusedNode(null)
|