feat: implement semantic search, knowledge unit extraction, and visualization components

This commit is contained in:
2026-05-03 15:59:30 +02:00
parent 94ecc7a404
commit 1f187b5125
24 changed files with 844 additions and 21 deletions
@@ -122,13 +122,19 @@ export function updateData(data) {
// Update Links
link = rootGroup.select(".links-layer")
.selectAll("path")
.data(data.links, d => d.source + "-" + d.target)
.data(data.links, d => d.source + "-" + d.target + "-" + d.relationType)
.join(
enter => enter.append("path")
.attr("stroke", "rgba(255,255,255,0.05)")
.attr("stroke", d => {
if (d.relationType === 'Defines') return 'var(--nexus-accent)';
if (d.relationType === 'Next') return 'rgba(255,255,255,0.2)';
if (d.relationType === 'Contains') return 'var(--nexus-neon)';
return 'rgba(255,255,255,0.1)';
})
.attr("fill", "none")
.attr("stroke-width", 1.5)
.call(e => e.transition().duration(500).attr("stroke", "rgba(255,255,255,0.1)")),
.attr("stroke-width", d => d.relationType === 'Defines' ? 2 : 1)
.attr("stroke-dasharray", d => d.relationType === 'References' ? "5,5" : "0")
.call(e => e.transition().duration(500).attr("opacity", 1)),
update => update,
exit => exit.remove()
);
@@ -150,7 +156,12 @@ export function updateData(data) {
g.append("circle")
.attr("r", 30)
.attr("fill", "url(#nebulaGlow)")
.attr("fill", d => {
if (d.type === 'Definition') return 'var(--nexus-accent)';
if (d.type === 'Table') return 'var(--nexus-neon)';
if (d.type === 'Rule') return '#ff4444';
return "url(#nebulaGlow)";
})
.attr("opacity", 0)
.transition().duration(1000).attr("opacity", d => d.group === 'current' ? 0.6 : 0.2);
@@ -162,14 +173,18 @@ export function updateData(data) {
.attr("height", 24)
.attr("rx", 12)
.attr("fill", "rgba(20, 20, 20, 0.9)")
.attr("stroke", "rgba(255, 255, 255, 0.1)")
.attr("stroke", d => {
if (d.type === 'Definition') return 'var(--nexus-accent)';
if (d.type === 'Rule') return '#ff4444';
return "rgba(255, 255, 255, 0.1)";
})
.attr("stroke-width", 1);
g.append("text")
.text(d => d.label)
.attr("text-anchor", "middle")
.attr("y", 4)
.attr("fill", "#ccc")
.attr("fill", d => d.type === 'Definition' ? 'var(--nexus-accent)' : '#ccc')
.attr("font-size", "0.8rem");
return g;