Knowledge base of ~80+ markdown files across 14 domains (00-13), Logseq graph, hardware design files (KiCAD), infrastructure configs, and talas-wiki static site. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
57 lines
2.5 KiB
HTML
57 lines
2.5 KiB
HTML
{{define "title"}}Inter-domain Dependencies — Talas Wiki{{end}}
|
|
|
|
{{define "content"}}
|
|
<div class="breadcrumb"><a href="/">/</a> / <span>dependencies</span></div>
|
|
<h1>Dependencies inter-domaines</h1>
|
|
<p class="subtitle">Liens entre domaines. Epaisseur = nombre de liens.</p>
|
|
<div id="deps-container" style="margin-top:16px;border:1px solid var(--border);background:var(--bg-alt)"></div>
|
|
{{end}}
|
|
|
|
{{define "scripts"}}
|
|
<script src="https://d3js.org/d3.v7.min.js"></script>
|
|
<script>
|
|
fetch('/api/domaindeps').then(function(r){return r.json()}).then(function(data){
|
|
var container = document.getElementById('deps-container');
|
|
var width = container.offsetWidth, height = 500;
|
|
var svg = d3.select('#deps-container').append('svg').attr('width', width).attr('height', height);
|
|
|
|
var domainMap = {};
|
|
data.domains.forEach(function(d,i) {
|
|
domainMap[d.FullDir] = {name: d.Number + ' ' + d.Name, color: data.colors[d.Number] || '#a3be8c', x: 0, y: 0};
|
|
});
|
|
|
|
// Arrange domains in a circle
|
|
var keys = Object.keys(domainMap);
|
|
keys.forEach(function(k, i) {
|
|
var angle = (2 * Math.PI * i) / keys.length - Math.PI/2;
|
|
domainMap[k].x = width/2 + Math.cos(angle) * Math.min(width, height) * 0.35;
|
|
domainMap[k].y = height/2 + Math.sin(angle) * Math.min(width, height) * 0.35;
|
|
});
|
|
|
|
var maxW = d3.max(data.deps, function(d){return d.weight}) || 1;
|
|
|
|
// Draw links
|
|
data.deps.forEach(function(dep) {
|
|
var s = domainMap[dep.source], t = domainMap[dep.target];
|
|
if (!s || !t) return;
|
|
svg.append('line')
|
|
.attr('x1', s.x).attr('y1', s.y).attr('x2', t.x).attr('y2', t.y)
|
|
.attr('stroke', '#2e3440').attr('stroke-width', Math.max(1, dep.weight / maxW * 6))
|
|
.attr('stroke-opacity', 0.5)
|
|
.append('title').text(dep.source + ' → ' + dep.target + ': ' + dep.weight + ' liens');
|
|
});
|
|
|
|
// Draw domain nodes
|
|
keys.forEach(function(k) {
|
|
var d = domainMap[k];
|
|
svg.append('circle').attr('cx', d.x).attr('cy', d.y).attr('r', 20)
|
|
.attr('fill', d.color).attr('stroke', '#121212').attr('stroke-width', 2)
|
|
.style('cursor', 'pointer')
|
|
.on('click', function(){ window.location = '/wiki/' + k; });
|
|
svg.append('text').attr('x', d.x).attr('y', d.y + 32)
|
|
.attr('text-anchor', 'middle').attr('fill', '#a3be8c').attr('font-size', 9)
|
|
.attr('font-family', 'JetBrains Mono, monospace').text(d.name);
|
|
});
|
|
});
|
|
</script>
|
|
{{end}}
|