feat: implement dynamic knowledge graph updates and state management services

This commit is contained in:
2026-04-26 14:53:48 +02:00
parent 412320980f
commit 7859c9806f
30 changed files with 668 additions and 153 deletions
@@ -6,6 +6,7 @@
@inject IMediator Mediator
@inject IJSRuntime JS
@inject IFocusModeService FocusMode
@inject IKnowledgeGraphService GraphService
<div class="knowledge-graph-container" id="@ContainerId">
@if (GraphData == null)
@@ -37,6 +38,21 @@
protected override void OnInitialized()
{
FocusMode.OnFocusModeChanged += HandleFocusSimulation;
GraphService.OnGraphUpdated += HandleGraphUpdate;
GraphService.OnActiveNodeChanged += HandleActiveNodeChange;
}
private async void HandleGraphUpdate()
{
if (_module == null) return;
await _module.InvokeVoidAsync("updateData", GraphService.CurrentGraphData);
await InvokeAsync(StateHasChanged);
}
private async void HandleActiveNodeChange(string nodeId)
{
if (_module == null) return;
await _module.InvokeVoidAsync("setActiveNode", nodeId);
}
protected override async Task OnAfterRenderAsync(bool firstRender)