xerboxion/.ploxion-graph/graph-viewer.html
2026-04-10 18:54:39 +00:00

848 lines
35 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>⬡ Xerboxion — Ploxion Network</title>
<!-- Cytoscape.js — local copy (cytoscape.min.js) bundled alongside this file -->
<!-- CDN fallback for environments without the local file -->
<script>
(function() {
var s = document.createElement('script');
s.src = 'cytoscape.min.js';
s.onload = function() { if (document.readyState === 'complete') { initGraph(); } else { window.addEventListener('load', initGraph); } };
s.onerror = function() {
var fb = document.createElement('script');
fb.src = 'https://cdnjs.cloudflare.com/ajax/libs/cytoscape/3.28.1/cytoscape.min.js';
fb.onload = function() { if (document.readyState === 'complete') { initGraph(); } else { window.addEventListener('load', initGraph); } };
document.head.appendChild(fb);
};
document.head.appendChild(s);
})();
</script>
<style>
:root {
--bg: #06060f;
--bg2: #0a0a1a;
--bg3: #0f0f28;
--border: #1c1c44;
--core-clr: #ff4081;
--plox-clr: #00e5ff;
--xer0n-clr: #aa44ff;
--plat-clr: #ff9100;
--text: #9090b8;
--text-hi: #d8d8f8;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body {
font-family: 'Courier New', Courier, monospace;
background: var(--bg);
color: var(--text);
height: 100vh;
display: flex;
flex-direction: column;
overflow: hidden;
}
/* ─── HEADER ─────────────────────────────────────────── */
header {
background: var(--bg2);
border-bottom: 1px solid var(--border);
padding: 10px 20px;
display: flex;
align-items: center;
justify-content: space-between;
flex-shrink: 0;
z-index: 10;
}
.h-left { display: flex; align-items: center; gap: 14px; }
.h-logo {
font-size: 20px;
font-weight: bold;
color: var(--plox-clr);
text-shadow: 0 0 20px var(--plox-clr);
letter-spacing: 4px;
}
.h-sub { font-size: 10px; color: #44446a; letter-spacing: 2px; }
.h-stats { display: flex; gap: 24px; }
.stat { display: flex; flex-direction: column; align-items: center; }
.stat-v { font-size: 16px; font-weight: bold; }
.stat-l { font-size: 9px; color: #44446a; letter-spacing: 1px; }
/* ─── LAYOUT ─────────────────────────────────────────── */
.app-body { flex: 1; display: flex; overflow: hidden; position: relative; }
/* ─── SIDEBAR ────────────────────────────────────────── */
.sidebar {
width: 248px;
background: var(--bg2);
border-right: 1px solid var(--border);
padding: 14px;
display: flex;
flex-direction: column;
gap: 18px;
overflow-y: auto;
flex-shrink: 0;
z-index: 5;
}
.sb-title {
font-size: 9px;
letter-spacing: 2px;
color: #33335a;
text-transform: uppercase;
padding-bottom: 5px;
border-bottom: 1px solid var(--border);
}
.sb-sec { display: flex; flex-direction: column; gap: 8px; }
/* Search */
.search-wrap { position: relative; }
.search-input {
background: var(--bg3);
border: 1px solid var(--border);
color: var(--text-hi);
padding: 7px 10px 7px 28px;
font-family: inherit;
font-size: 11px;
width: 100%;
outline: none;
transition: border-color .2s, box-shadow .2s;
}
.search-input:focus {
border-color: var(--plox-clr);
box-shadow: 0 0 10px rgba(0,229,255,.15);
}
.search-icon {
position: absolute;
left: 9px;
top: 50%;
transform: translateY(-50%);
font-size: 12px;
color: #33335a;
pointer-events: none;
}
.search-clear {
position: absolute;
right: 8px;
top: 50%;
transform: translateY(-50%);
font-size: 14px;
color: #33335a;
cursor: pointer;
display: none;
}
.search-clear:hover { color: var(--text); }
/* Filter buttons */
.filter-btn {
display: flex;
align-items: center;
gap: 8px;
padding: 7px 10px;
background: var(--bg3);
border: 1px solid var(--border);
cursor: pointer;
font-family: inherit;
font-size: 11px;
color: var(--text);
transition: all .2s;
width: 100%;
text-align: left;
}
.filter-btn:hover { background: #0f0f30; }
.filter-btn.active { border-color: rgba(255,255,255,.12); }
.filter-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.filter-label { flex: 1; }
.filter-count { font-size: 9px; color: #33335a; }
/* Layout buttons */
.layout-row { display: flex; gap: 6px; }
.layout-btn {
flex: 1;
padding: 6px 4px;
background: var(--bg3);
border: 1px solid var(--border);
color: var(--text);
font-family: inherit;
font-size: 10px;
cursor: pointer;
transition: all .2s;
letter-spacing: .5px;
}
.layout-btn:hover, .layout-btn.active {
border-color: var(--plox-clr);
color: var(--plox-clr);
background: rgba(0,229,255,.04);
}
/* Legend */
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.leg-box {
width: 22px;
height: 13px;
border: 2px solid;
background: rgba(255,255,255,.04);
flex-shrink: 0;
}
.leg-diamond {
width: 13px;
height: 13px;
border: 2px solid;
transform: rotate(45deg);
background: rgba(255,255,255,.04);
flex-shrink: 0;
}
.edge-row { display: flex; align-items: center; gap: 8px; font-size: 10px; }
.edge-line { width: 22px; height: 1px; }
/* ─── GRAPH ──────────────────────────────────────────── */
#cy {
flex: 1;
background-color: var(--bg);
background-image:
radial-gradient(circle at 15% 55%, rgba(0,80,200,.04) 0%, transparent 50%),
radial-gradient(circle at 85% 20%, rgba(120,0,220,.04) 0%, transparent 50%),
linear-gradient(rgba(28,28,64,.25) 1px, transparent 1px),
linear-gradient(90deg, rgba(28,28,64,.25) 1px, transparent 1px);
background-size: auto, auto, 40px 40px, 40px 40px;
}
/* ─── ZOOM CONTROLS ──────────────────────────────────── */
.zoom-controls {
position: absolute;
bottom: 20px;
left: 264px;
display: flex;
flex-direction: column;
gap: 4px;
z-index: 10;
}
.z-btn {
width: 34px;
height: 34px;
background: var(--bg2);
border: 1px solid var(--border);
color: var(--text);
font-size: 15px;
cursor: pointer;
display: flex;
align-items: center;
justify-content: center;
transition: all .2s;
}
.z-btn:hover { border-color: var(--plox-clr); color: var(--plox-clr); }
/* ─── DETAIL PANEL ───────────────────────────────────── */
.detail-panel {
width: 290px;
background: var(--bg2);
border-left: 1px solid var(--border);
padding: 18px;
overflow-y: auto;
flex-shrink: 0;
z-index: 5;
}
.dp-empty {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
gap: 10px;
color: #222244;
text-align: center;
}
.dp-empty-icon { font-size: 44px; }
.dp-empty-text { font-size: 11px; line-height: 1.6; }
.dp-type-badge {
display: inline-block;
padding: 2px 8px;
font-size: 9px;
letter-spacing: 2px;
text-transform: uppercase;
margin-bottom: 8px;
}
.dp-name {
font-size: 17px;
font-weight: bold;
color: var(--text-hi);
letter-spacing: 1px;
line-height: 1.3;
}
.dp-desc { font-size: 11px; line-height: 1.65; margin-top: 10px; }
.dp-sec { margin-top: 16px; }
.dp-sec-title {
font-size: 9px;
letter-spacing: 2px;
text-transform: uppercase;
color: #33335a;
margin-bottom: 7px;
}
.dp-meta { display: flex; flex-direction: column; gap: 5px; }
.dp-row { display: flex; gap: 8px; font-size: 11px; }
.dp-key { color: #44446a; min-width: 70px; flex-shrink: 0; }
.dp-val { color: var(--text-hi); }
.dp-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.dp-chip {
padding: 2px 7px;
font-size: 9px;
border: 1px solid;
border-radius: 1px;
letter-spacing: .5px;
}
.dp-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.dp-tag {
padding: 2px 6px;
background: var(--bg3);
border: 1px solid var(--border);
font-size: 9px;
color: #55557a;
}
.dp-link {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
margin-top: 18px;
padding: 8px 14px;
background: var(--bg3);
border: 1px solid var(--border);
color: var(--plox-clr);
text-decoration: none;
font-size: 10px;
letter-spacing: 1px;
transition: all .2s;
}
.dp-link:hover { background: rgba(0,229,255,.05); }
/* Status dots */
.s-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }
.s-alpha { background: #ffaa00; box-shadow: 0 0 5px #ffaa00; }
.s-beta { background: #00aaff; box-shadow: 0 0 5px #00aaff; }
.s-stable { background: #00ff88; box-shadow: 0 0 5px #00ff88; }
.s-concept{ background: #555577; box-shadow: 0 0 5px #555577; }
/* Scrollbar */
::-webkit-scrollbar { width: 3px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); }
</style>
</head>
<body>
<!-- ══ HEADER ══════════════════════════════════════════════ -->
<header>
<div class="h-left">
<div class="h-logo">⬡ XERBOXION</div>
<div>
<div style="font-size:13px;color:var(--text-hi);letter-spacing:2px;">PLOXION NETWORK</div>
<div class="h-sub">REPOVERSE v1.0 · INTERACTIVE DEPENDENCY GRAPH</div>
</div>
</div>
<div class="h-stats">
<div class="stat"><div class="stat-v" style="color:var(--core-clr)">1</div><div class="stat-l">CORE</div></div>
<div class="stat"><div class="stat-v" style="color:var(--plox-clr)">5</div><div class="stat-l">PLOXIONS</div></div>
<div class="stat"><div class="stat-v" style="color:var(--xer0n-clr)">2</div><div class="stat-l">XERI0NS</div></div>
<div class="stat"><div class="stat-v" style="color:var(--plat-clr)">4</div><div class="stat-l">PLATFORMS</div></div>
<div class="stat"><div class="stat-v" style="color:var(--text-hi)">24</div><div class="stat-l">LINKS</div></div>
</div>
</header>
<!-- ══ BODY ════════════════════════════════════════════════ -->
<div class="app-body">
<!-- ── SIDEBAR ── -->
<div class="sidebar">
<div class="sb-sec">
<div class="sb-title">Search</div>
<div class="search-wrap">
<span class="search-icon">⌕</span>
<input id="search" class="search-input" type="text" placeholder="name, tag, capability…" />
<span class="search-clear" id="search-clear" onclick="clearSearch()">×</span>
</div>
</div>
<div class="sb-sec">
<div class="sb-title">Filters</div>
<button id="f-core" class="filter-btn active" onclick="toggleFilter('core')">
<div class="filter-dot" style="background:var(--core-clr);box-shadow:0 0 6px var(--core-clr)"></div>
<span class="filter-label">Core Runtime</span>
<span class="filter-count">1</span>
</button>
<button id="f-ploxion" class="filter-btn active" onclick="toggleFilter('ploxion')">
<div class="filter-dot" style="background:var(--plox-clr);box-shadow:0 0 6px var(--plox-clr)"></div>
<span class="filter-label">Ploxions</span>
<span class="filter-count">5</span>
</button>
<button id="f-xeri0n" class="filter-btn active" onclick="toggleFilter('xeri0n')">
<div class="filter-dot" style="background:var(--xer0n-clr);box-shadow:0 0 6px var(--xer0n-clr)"></div>
<span class="filter-label">Xeri0ns</span>
<span class="filter-count">2</span>
</button>
<button id="f-platform" class="filter-btn active" onclick="toggleFilter('platform')">
<div class="filter-dot" style="background:var(--plat-clr);box-shadow:0 0 6px var(--plat-clr)"></div>
<span class="filter-label">Platforms</span>
<span class="filter-count">4</span>
</button>
</div>
<div class="sb-sec">
<div class="sb-title">Layout</div>
<div class="layout-row">
<button class="layout-btn active" id="l-cose" onclick="setLayout('cose')">Force</button>
<button class="layout-btn" id="l-breadthfirst" onclick="setLayout('breadthfirst')">Tree</button>
<button class="layout-btn" id="l-circle" onclick="setLayout('circle')">Circle</button>
</div>
</div>
<div class="sb-sec">
<div class="sb-title">Legend — Nodes</div>
<div class="legend-item">
<div class="leg-box" style="border-color:var(--core-clr);width:26px;height:15px;"></div>
<span style="color:var(--core-clr)">Core Runtime</span>
</div>
<div class="legend-item">
<div class="leg-box" style="border-color:var(--plox-clr)"></div>
<span style="color:var(--plox-clr)">Ploxion</span>
</div>
<div class="legend-item">
<div class="leg-diamond" style="border-color:var(--xer0n-clr)"></div>
<span style="color:var(--xer0n-clr)">Xeri0n (AI Agent)</span>
</div>
<div class="legend-item">
<div class="leg-box" style="border-color:var(--plat-clr);border-style:dashed"></div>
<span style="color:var(--plat-clr)">Platform</span>
</div>
<div class="sb-title" style="margin-top:6px">Legend — Edges</div>
<div class="edge-row">
<div class="edge-line" style="background:var(--plox-clr);height:2px"></div>
<span>depends-on</span>
</div>
<div class="edge-row">
<div class="edge-line" style="background:var(--xer0n-clr);border-top:1px dashed var(--xer0n-clr);height:0"></div>
<span>consumes</span>
</div>
<div class="edge-row">
<div class="edge-line" style="background:#444466;height:1px"></div>
<span>references / inspired-by</span>
</div>
</div>
<div class="sb-sec" style="margin-top:auto;padding-top:8px;border-top:1px solid var(--border)">
<a href="https://github.com/J0bot/xerboxion" target="_blank"
style="font-size:10px;color:#33335a;text-decoration:none;letter-spacing:1px">
⬡ github.com/J0bot/xerboxion
</a>
</div>
</div>
<!-- ── GRAPH CANVAS ── -->
<div id="cy"></div>
<!-- ── ZOOM CONTROLS ── -->
<div class="zoom-controls">
<button class="z-btn" onclick="cy.fit(null,40)" title="Fit all">⊡</button>
<button class="z-btn" onclick="cy.zoom(cy.zoom()*1.35);cy.center()" title="Zoom in">+</button>
<button class="z-btn" onclick="cy.zoom(cy.zoom()*.75);cy.center()" title="Zoom out">−</button>
<button class="z-btn" onclick="resetHL()" title="Clear highlight">↺</button>
</div>
<!-- ── DETAIL PANEL ── -->
<div class="detail-panel" id="dp">
<div class="dp-empty" id="dp-empty">
<div class="dp-empty-icon">⬡</div>
<div class="dp-empty-text">Click any node to inspect<br>component details</div>
</div>
<div id="dp-content" style="display:none"></div>
</div>
</div><!-- app-body -->
<!-- ══ SCRIPT ══════════════════════════════════════════════ -->
<script>
// ── DATA ─────────────────────────────────────────────────────────────
const NODES = [
/* CORE */
{ id:'xerboxion-core', name:'Xerboxion Core', type:'core', tier:'foundation',
desc:'Core runtime, process manager, IPC bus, and PLC registry — the foundational layer upon which every other ploxion runs. No external dependencies.',
status:'alpha', lang:'Rust', repo:'https://github.com/J0bot/xerboxion-core',
provides:['runtime','process-manager','ipc-bus','plc-registry','health-api'],
requires:[],
tags:['core','runtime','kernel','rust','plc'] },
/* PLOXIONS */
{ id:'xerax', name:'Xerax', type:'ploxion', tier:'interface',
desc:'Brain-Computer Interface ploxion. Acquires EEG signals via BrainFlow, trains neural networks, and translates thought-patterns into typed commands.',
status:'alpha', lang:'Python', repo:'https://github.com/J0bot/xerax',
provides:['thought-commands','eeg-stream','neural-model','bci-api'],
requires:['runtime'],
tags:['bci','eeg','neural','brainflow','thought-control'] },
{ id:'cubion', name:'Cubion', type:'ploxion', tier:'storage',
desc:'Distributed modular storage ploxion. Implements the Cubion hardware standard in software: pluggable cube-shaped storage units with physical-world anchoring.',
status:'alpha', lang:'Rust', repo:'https://github.com/J0bot/cubion',
provides:['storage-api','cube-db','sync-protocol','cubion-link'],
requires:['runtime'],
tags:['storage','database','cubion','distributed','hardware'] },
{ id:'room-map', name:'Room Map', type:'ploxion', tier:'spatial',
desc:'Spatial mapping ploxion. Builds and maintains real-time 3D maps of physical environments to give the ecosystem spatial awareness.',
status:'alpha', lang:'TypeScript', repo:'https://github.com/J0bot/room-map',
provides:['spatial-map','room-model','location-api'],
requires:['storage-api','runtime'],
tags:['spatial','mapping','3d','environment','lidar'] },
{ id:'xerfarm', name:'Xerfarm', type:'ploxion', tier:'resources',
desc:'Agriculture and resource-management ploxion. Automates cultivation, tracks resource flows, and manages harvest operations.',
status:'alpha', lang:'Python', repo:'https://github.com/J0bot/Xerfarm',
provides:['resource-manager','farm-control','harvest-api'],
requires:['storage-api','spatial-map','runtime'],
tags:['agriculture','resources','automation','food','sustainability'] },
{ id:'galactic-architect', name:'Galactic Architect', type:'ploxion', tier:'universe',
desc:'Universe-architecture ploxion. Manages the meta-structure of the Xerboxion digital multiverse — dimensions, galactic topologies, and reality layers.',
status:'concept', lang:'TypeScript', repo:'https://github.com/J0bot/galactic_architect',
provides:['universe-api','dimension-manager','architect-query','galaxy-db'],
requires:['storage-api','spatial-map','runtime'],
tags:['universe','architecture','galactic','meta','dimensions'] },
/* XERI0NS */
{ id:'swarm-xerboxion', name:'Swarm Xerboxion', type:'xeri0n', tier:'orchestration',
desc:'Multi-agent orchestration xeri0n. Coordinates autonomous workers via Mission Core, Memory Core, Agent Core, IPC server, and a Discord adapter.',
status:'alpha', lang:'TypeScript', repo:'https://github.com/J0bot/swarm-xerboxion',
provides:['agent-pool','mission-queue','memory-core','coordinator','discord-adapter'],
requires:['runtime','ipc-bus','storage-api'],
tags:['swarm','agents','orchestration','autonomous','discord','ipc'] },
{ id:'galactic-jarvis', name:'Galactic Jarvis', type:'xeri0n', tier:'ai',
desc:'High-level AI assistant xeri0n. Provides natural-language reasoning, long-horizon planning, and full universe context across the entire ecosystem.',
status:'concept', lang:'Python', repo:'https://github.com/J0bot/galactic-_jarvis',
provides:['ai-assistant','nlp-api','planning-core'],
requires:['agent-pool','universe-api','memory-core','runtime'],
tags:['ai','assistant','galactic','nlp','llm','planning'] },
/* PLATFORMS */
{ id:'xerboxion-os', name:'Xerboxion OS', type:'platform', tier:'os',
desc:'Main OS platform. Rust/Flutter application for Android providing the primary user interface, shell, and OS integration layer for the Xerboxion ecosystem.',
status:'alpha', lang:'Rust / Flutter', repo:'https://github.com/J0bot/xerboxion-os',
provides:['ui-shell','os-layer','user-interface'],
requires:['runtime','thought-commands','storage-api'],
tags:['os','android','flutter','ui','shell'] },
{ id:'minecraft-os', name:'Minecraft OS', type:'platform', tier:'prototype',
desc:'Minecraft Fabric prototype of Xerboxion concepts. Items: BION, CUBION, XER, BOXION, XERBOXION. Features CC:Tweaked Lua kernel and fractal Cube Navigator.',
status:'beta', lang:'Java', repo:'https://github.com/J0bot/minecraft-os',
provides:['minecraft-ui','cube-navigator','cc-kernel','prototype-env'],
requires:['storage-api'],
tags:['minecraft','fabric','prototype','cctweaked','cubion','lua'] },
{ id:'xerboxion-web', name:'Xerboxion Web', type:'platform', tier:'web',
desc:'Web frontend platform. Browser-based access to all ploxion services, agent dashboard, and real-time ecosystem monitoring.',
status:'alpha', lang:'TypeScript', repo:'https://github.com/J0bot/xerboxion-web',
provides:['web-ui','browser-interface','dashboard'],
requires:['runtime','agent-pool'],
tags:['web','frontend','typescript','dashboard','realtime'] },
{ id:'my-website', name:'j0bot.ch', type:'platform', tier:'portal',
desc:'Personal site and Xerboxion portal. Laravel app with the Xerboxion paper, XerboxionComment system, OAuth2/WebAuthn, and GPG challenge authentication.',
status:'stable', lang:'PHP / Laravel', repo:'https://github.com/J0bot/my_website2',
provides:['portal','paper-viewer','auth-layer','comment-system'],
requires:[],
tags:['website','laravel','portal','paper','oauth2','webauthn'] },
];
const EDGES = [
// Core dependencies
{id:'e01',s:'xerax', t:'xerboxion-core', type:'depends-on', lbl:'PLC v0'},
{id:'e02',s:'cubion', t:'xerboxion-core', type:'depends-on', lbl:'PLC v0'},
{id:'e03',s:'room-map', t:'xerboxion-core', type:'depends-on', lbl:'PLC v0'},
{id:'e04',s:'xerfarm', t:'xerboxion-core', type:'depends-on', lbl:'PLC v0'},
{id:'e05',s:'galactic-architect',t:'xerboxion-core', type:'depends-on', lbl:'PLC v0'},
{id:'e06',s:'swarm-xerboxion', t:'xerboxion-core', type:'depends-on', lbl:'IPC bus'},
// Storage mesh
{id:'e07',s:'room-map', t:'cubion', type:'consumes', lbl:'storage'},
{id:'e08',s:'xerfarm', t:'cubion', type:'consumes', lbl:'storage'},
{id:'e09',s:'galactic-architect',t:'cubion', type:'consumes', lbl:'galaxy-db'},
{id:'e10',s:'swarm-xerboxion', t:'cubion', type:'consumes', lbl:'memory'},
// Spatial mesh
{id:'e11',s:'xerfarm', t:'room-map', type:'consumes', lbl:'spatial'},
{id:'e12',s:'galactic-architect',t:'room-map', type:'consumes', lbl:'spatial'},
// Xeri0n wiring
{id:'e13',s:'swarm-xerboxion', t:'galactic-architect',type:'consumes', lbl:'universe'},
{id:'e14',s:'swarm-xerboxion', t:'xerax', type:'consumes', lbl:'thought-cmd'},
{id:'e15',s:'xerfarm', t:'swarm-xerboxion', type:'consumes', lbl:'automation'},
{id:'e16',s:'galactic-jarvis', t:'swarm-xerboxion', type:'depends-on', lbl:'agents'},
{id:'e17',s:'galactic-jarvis', t:'galactic-architect',type:'consumes', lbl:'universe'},
// Platform wiring
{id:'e18',s:'xerboxion-os', t:'xerboxion-core', type:'depends-on', lbl:'native'},
{id:'e19',s:'xerboxion-os', t:'xerax', type:'consumes', lbl:'thought-ctrl'},
{id:'e20',s:'xerboxion-os', t:'cubion', type:'consumes', lbl:'storage'},
{id:'e21',s:'minecraft-os', t:'cubion', type:'inspired-by', lbl:'concept'},
{id:'e22',s:'xerboxion-web', t:'xerboxion-core', type:'depends-on', lbl:'HTTP/WS'},
{id:'e23',s:'xerboxion-web', t:'swarm-xerboxion', type:'consumes', lbl:'missions'},
{id:'e24',s:'my-website', t:'xerboxion-core', type:'references', lbl:'docs'},
];
// ── COLOR MAP ─────────────────────────────────────────────────────────
const COLOR = {
core: '#ff4081',
ploxion: '#00e5ff',
xeri0n: '#aa44ff',
platform:'#ff9100',
};
// ── STATE ─────────────────────────────────────────────────────────────
const activeFilters = new Set(['core','ploxion','xeri0n','platform']);
let currentLayout = 'cose';
let cy; // initialized in initGraph()
// ── BUILD ELEMENTS ────────────────────────────────────────────────────
function buildElements() {
const visSet = new Set(NODES.filter(n => activeFilters.has(n.type)).map(n => n.id));
const els = [];
for (const n of NODES) {
if (!visSet.has(n.id)) continue;
els.push({ data: { id: n.id, name: n.name, type: n.type, tier: n.tier,
desc: n.desc, status: n.status, lang: n.lang, repo: n.repo,
provides: n.provides, requires: n.requires, tags: n.tags,
color: COLOR[n.type] || '#888' }});
}
for (const e of EDGES) {
if (!visSet.has(e.s) || !visSet.has(e.t)) continue;
els.push({ data: { id: e.id, source: e.s, target: e.t, type: e.type, label: e.lbl }});
}
return els;
}
// ── LAYOUT CONFIGS ────────────────────────────────────────────────────
function layoutCfg(name) {
const base = { animate: true, animationDuration: 650, padding: 44 };
if (name === 'cose') return { ...base, name: 'cose',
nodeRepulsion: 9000, idealEdgeLength: 130, edgeElasticity: 0.4, gravity: 1.4, randomize: false };
if (name === 'breadthfirst') return { ...base, name: 'breadthfirst',
directed: true, roots: '#xerboxion-core', spacingFactor: 1.6 };
if (name === 'circle') return { ...base, name: 'circle' };
return { ...base, name };
}
function setLayout(name) {
currentLayout = name;
document.querySelectorAll('.layout-btn').forEach(b => b.classList.remove('active'));
document.getElementById('l-' + name).classList.add('active');
cy.layout(layoutCfg(name)).run();
}
// ── HIGHLIGHT / DIM ───────────────────────────────────────────────────
function hlNode(node) {
cy.elements().removeClass('hl').addClass('dim');
node.removeClass('dim').addClass('hl');
node.connectedEdges().removeClass('dim').addClass('hl');
node.connectedEdges().connectedNodes().removeClass('dim').addClass('hl');
}
function resetHL() {
cy.elements().removeClass('hl dim');
}
// ── INIT (called after Cytoscape.js finishes loading) ─────────────────
function initGraph() {
// ── CYTOSCAPE ─────────────────────────────────────────────────────────
cy = cytoscape({
container: document.getElementById('cy'),
elements: buildElements(),
style: [
{ selector: 'node', style: {
'background-color': 'data(color)',
'background-opacity': 0.12,
'border-width': 2,
'border-color': 'data(color)',
'label': 'data(name)',
'color': '#c8c8e8',
'font-size': '11px',
'font-family': '"Courier New", monospace',
'text-valign': 'center',
'text-halign': 'center',
'text-wrap': 'wrap',
'text-max-width': '86px',
'width': 100,
'height': 42,
'shape': 'round-rectangle',
'transition-property':'background-opacity, border-width',
'transition-duration':'200ms',
}},
{ selector: 'node[type = "core"]', style: {
'width': 124, 'height': 50, 'font-size': '12px', 'font-weight': 'bold',
'border-width': 3, 'background-opacity': 0.22,
}},
{ selector: 'node[type = "xeri0n"]', style: {
'shape': 'diamond', 'width': 92, 'height': 92, 'font-size': '10px',
}},
{ selector: 'node[type = "platform"]', style: {
'border-style': 'dashed', 'border-width': 1.5,
}},
{ selector: 'node:selected', style: {
'border-width': 3.5, 'background-opacity': 0.35,
}},
{ selector: 'node.hl', style: {
'border-width': 3, 'background-opacity': 0.28,
}},
{ selector: 'node.dim', style: { 'opacity': 0.18 }},
// Edges
{ selector: 'edge', style: {
'width': 1.5,
'line-color': '#1a1a42',
'target-arrow-color': '#1a1a42',
'target-arrow-shape': 'vee',
'curve-style': 'bezier',
'opacity': 0.7,
'font-size': '8px',
'font-family': '"Courier New", monospace',
'color': '#333355',
'text-background-opacity': 0,
'transition-property': 'opacity, line-color',
'transition-duration': '200ms',
}},
{ selector: 'edge[type = "depends-on"]', style: {
'line-color': '#1a4060', 'target-arrow-color': '#1a4060', 'width': 2,
}},
{ selector: 'edge[type = "consumes"]', style: {
'line-color': '#3a1060', 'target-arrow-color': '#3a1060',
'line-style': 'dashed', 'line-dash-pattern': [5,3],
}},
{ selector: 'edge[type = "inspired-by"]', style: {
'line-color': '#503010', 'target-arrow-color': '#503010',
'line-style': 'dotted', 'opacity': 0.45,
}},
{ selector: 'edge[type = "references"]', style: {
'line-color': '#222244', 'target-arrow-color': '#222244', 'opacity': 0.35,
}},
{ selector: 'edge.hl', style: {
'opacity': 1, 'width': 2.8, 'line-color': '#4040a0', 'target-arrow-color': '#4040a0',
}},
{ selector: 'edge.dim', style: { 'opacity': 0.04 }},
],
layout: layoutCfg('cose'),
wheelSensitivity: 0.25,
});
// ── EVENTS ────────────────────────────────────────────────────────────
cy.on('tap', 'node', evt => { hlNode(evt.target); showDetail(evt.target.data()); });
cy.on('tap', evt => { if (evt.target === cy) { resetHL(); hideDetail(); } });
cy.on('mouseover', 'node', () => { document.getElementById('cy').style.cursor = 'pointer'; });
cy.on('mouseout', 'node', () => { document.getElementById('cy').style.cursor = 'default'; });
// ── SEARCH ────────────────────────────────────────────────────────────
document.getElementById('search').addEventListener('input', function() {
const q = this.value.toLowerCase().trim();
document.getElementById('search-clear').style.display = q ? 'block' : 'none';
if (!q) { resetHL(); return; }
cy.elements().removeClass('hl').addClass('dim');
cy.nodes().filter(n =>
n.data('name').toLowerCase().includes(q) ||
(n.data('tags')||[]).some(t => t.includes(q)) ||
(n.data('provides')||[]).some(p => p.includes(q)) ||
(n.data('requires')||[]).some(r => r.includes(q))
).removeClass('dim').addClass('hl');
});
} // end initGraph()
// ── DETAIL PANEL ──────────────────────────────────────────────────────
function showDetail(d) {
document.getElementById('dp-empty').style.display = 'none';
const el = document.getElementById('dp-content');
el.style.display = 'block';
const c = COLOR[d.type] || '#888';
const sClass = { alpha:'s-alpha', beta:'s-beta', stable:'s-stable', concept:'s-concept' }[d.status] || 's-concept';
const chips = (arr, clr, dim) => (arr||[]).map(x =>
`<span class="dp-chip" style="border-color:${clr};color:${clr}">${x}</span>`).join('');
el.innerHTML = `
<div style="margin-bottom:14px">
<span class="dp-type-badge" style="background:${c}1a;color:${c};border:1px solid ${c}33">
${d.type.toUpperCase()}
</span>
<div class="dp-name">${d.name}</div>
<div class="dp-desc">${d.desc}</div>
</div>
<div class="dp-sec">
<div class="dp-sec-title">Metadata</div>
<div class="dp-meta">
<div class="dp-row">
<span class="dp-key">Status</span>
<span class="dp-val"><span class="s-dot ${sClass}"></span>${d.status||'—'}</span>
</div>
<div class="dp-row">
<span class="dp-key">Language</span>
<span class="dp-val">${d.lang||'—'}</span>
</div>
<div class="dp-row">
<span class="dp-key">Tier</span>
<span class="dp-val">${d.tier||'—'}</span>
</div>
</div>
</div>
${(d.provides||[]).length ? `
<div class="dp-sec">
<div class="dp-sec-title">Provides</div>
<div class="dp-chips">${chips(d.provides, c)}</div>
</div>` : ''}
${(d.requires||[]).length ? `
<div class="dp-sec">
<div class="dp-sec-title">Requires</div>
<div class="dp-chips">${chips(d.requires, '#4444aa')}</div>
</div>` : ''}
${(d.tags||[]).length ? `
<div class="dp-sec">
<div class="dp-sec-title">Tags</div>
<div class="dp-tags">${(d.tags).map(t=>`<span class="dp-tag">${t}</span>`).join('')}</div>
</div>` : ''}
<a href="${d.repo}" target="_blank" class="dp-link" style="color:${c};border-color:${c}44">
↗ Open Repository
</a>`;
}
function hideDetail() {
document.getElementById('dp-empty').style.display = 'flex';
document.getElementById('dp-content').style.display = 'none';
}
function clearSearch() {
document.getElementById('search').value = '';
document.getElementById('search-clear').style.display = 'none';
resetHL();
}
// ── FILTERS ───────────────────────────────────────────────────────────
function toggleFilter(type) {
if (!cy) return;
const btn = document.getElementById('f-' + type);
if (activeFilters.has(type)) {
activeFilters.delete(type);
btn.classList.remove('active');
btn.style.opacity = '0.38';
} else {
activeFilters.add(type);
btn.classList.add('active');
btn.style.opacity = '1';
}
hideDetail();
resetHL();
cy.elements().remove();
cy.add(buildElements());
cy.layout(layoutCfg(currentLayout)).run();
}
</script>
</body>
</html>