Spaces:
Configuration error
Configuration error
fix: unique folder colors, edge labels on hover only, stronger repulsion
Browse files1226 unmodified lines1227122812291230123112321078 unmodified lines2311231223132314231523162317205 unmodified lines2523252425252526252725282529253025317 unmodified lines253925402541254225432544254525461226 unmodified linesdecision: '#6B3FA0', pattern: '#2563EB', library: '#C2410C', person: '#111111',folder: '#4F46E5'};var OP_BADGES = {observe: 'badge-blue', compress: 'badge-cyan', remember: 'badge-green',forget: 'badge-red', evolve: 'badge-purple', consolidate: 'badge-yellow',1078 unmodified linesgraphSim.tickCount = (graphSim.tickCount || 0) + 1;var coolBoost = Math.min(0.4, graphSim.tickCount / 1500);var damping = 0.9 - coolBoost;var repulsion = nodeCount > 1000 ? 3000 : nodeCount > 100 ? 2000 : nodeCount > 50 ? 1800 : nodeCount > 10 ? 3500 : 6000;var attraction = nodeCount > 100 ? 0.002 : 0.005;var centerGravity = nodeCount > 1000 ? 0.012 : nodeCount > 100 ? 0.005 : 0.01;var velocityCap = nodeCount > 1000 ? 6 : nodeCount > 200 ? 12 : 24;205 unmodified linesctx.fill();}var showEdgeLabel = e.type && !edgeDimmed && (s.type === 'folder' || t.type === 'folder' || isConnectedToFocus ? graphSim.zoom > 0.4 : graphSim.zoom > edgeLabelZoomThreshold);if (showEdgeLabel) {var zoomInv = 1 / graphSim.zoom;ctx.save();7 unmodified linesgraphSim.nodes.forEach(function(n) {if (!state.graph.filters[n.type]) return;var color = NODE_COLORS[n.type] || '#666666';var isSelected = selectedId === n.id;var isHovered = hoverNodeId === n.id;var matchesSearch = !searchActive || n.name.toLowerCase().includes(graphSearchTerm);var isFocusFaded = focusNodeId && n.id !== focusNodeId && !graphSim.edges.some(function(ed) {1226 unmodified lines1227122812291230123112321233123412351236123712381239124012411078 unmodified lines2320232123222323232423252326205 unmodified lines25322533253425352536253725387 unmodified lines25462547254825492550255125521226 unmodified linesdecision: '#6B3FA0', pattern: '#2563EB', library: '#C2410C', person: '#111111',folder: '#4F46E5'};function folderColor(id) {var h = 0;for (var i = 0; i < id.length; i++) { h = (h * 31 + id.charCodeAt(i)) & 0xfffffff; }var hue = (h % 360 + 360) % 360;var sat = 55 + (h % 25);var lig = isDarkMode() ? 52 + (h % 16) : 38 + (h % 14);return 'hsl(' + hue + ',' + sat + '%,' + lig + '%)';}var OP_BADGES = {observe: 'badge-blue', compress: 'badge-cyan', remember: 'badge-green',forget: 'badge-red', evolve: 'badge-purple', consolidate: 'badge-yellow',1078 unmodified linesgraphSim.tickCount = (graphSim.tickCount || 0) + 1;var coolBoost = Math.min(0.4, graphSim.tickCount / 1500);var damping = 0.9 - coolBoost;var repulsion = nodeCount > 1000 ? 3000 : nodeCount > 100 ? 2000 : nodeCount > 50 ? 1800 : nodeCount > 10 ? 8000 : 18000;var attraction = nodeCount > 100 ? 0.002 : 0.005;var centerGravity = nodeCount > 1000 ? 0.012 : nodeCount > 100 ? 0.005 : 0.01;var velocityCap = nodeCount > 1000 ? 6 : nodeCount > 200 ? 12 : 24;205 unmodified linesctx.fill();}var showEdgeLabel = e.type && !edgeDimmed && isConnectedToFocus && graphSim.zoom > 0.4;if (showEdgeLabel) {var zoomInv = 1 / graphSim.zoom;ctx.save();7 unmodified linesgraphSim.nodes.forEach(function(n) {if (!state.graph.filters[n.type]) return;var color = n.type === 'folder' ? folderColor(n.id) : (NODE_COLORS[n.type] || '#666666');var isHovered = hoverNodeId === n.id;var matchesSearch = !searchActive || n.name.toLowerCase().includes(graphSearchTerm);var isFocusFaded = focusNodeId && n.id !== focusNodeId && !graphSim.edges.some(function(ed) {
src/viewer/index.html+12-6